Alexa Hosted Skillの環境変数をみる

ただの好奇心。 調べ方 console.log(JSON.stringify(process.env))を仕込んでCloudWatch Logsから見ます。 とりあえず変数名リスト マズそうな値をマスクした状態 使い所の […]

広告ここから
広告ここまで

目次

    ただの好奇心。

    調べ方

    console.log(JSON.stringify(process.env))を仕込んでCloudWatch Logsから見ます。

    とりあえず変数名リスト

    [
      "AWS_ACCESS_KEY_ID",
      "AWS_DEFAULT_REGION",
      "AWS_EXECUTION_ENV",
      "AWS_LAMBDA_FUNCTION_MEMORY_SIZE",
      "AWS_LAMBDA_FUNCTION_NAME",
      "AWS_LAMBDA_FUNCTION_VERSION",
      "AWS_LAMBDA_LOG_GROUP_NAME",
      "AWS_LAMBDA_LOG_STREAM_NAME",
      "AWS_REGION",
      "AWS_SECRET_ACCESS_KEY",
      "AWS_SESSION_TOKEN",
      "AWS_XRAY_CONTEXT_MISSING",
      "AWS_XRAY_DAEMON_ADDRESS",
      "LAMBDA_RUNTIME_DIR",
      "LAMBDA_TASK_ROOT",
      "LANG",
      "LD_LIBRARY_PATH",
      "NODE_PATH",
      "PATH",
      "S3_PERSISTENCE_BUCKET",
      "TZ",
      "_AWS_XRAY_DAEMON_ADDRESS",
      "_AWS_XRAY_DAEMON_PORT",
      "_HANDLER",
      "_X_AMZN_TRACE_ID"
    ]

    マズそうな値をマスクした状態

    {
      "S3_PERSISTENCE_BUCKET": "amzn1-ask-skill-XXXX-buildsnapshotbucket-XXXX",
      "PATH": "/var/lang/bin:/usr/local/bin:/usr/bin/:/bin:/opt/bin",
      "LD_LIBRARY_PATH": "/var/lang/lib:/lib64:/usr/lib64:/var/runtime:/var/runtime/lib:/var/task:/var/task/lib:/opt/lib",
      "LANG": "en_US.UTF-8",
      "TZ": ":UTC",
      "LAMBDA_TASK_ROOT": "/var/task",
      "LAMBDA_RUNTIME_DIR": "/var/runtime",
      "AWS_REGION": "us-east-1",
      "AWS_DEFAULT_REGION": "us-east-1",
      "AWS_LAMBDA_LOG_GROUP_NAME": "/aws/lambda/1beb394c-81dc-41b0-9a4d-c701639ee033",
      "AWS_LAMBDA_LOG_STREAM_NAME": "2019/02/17/[8]eb7252959b2e409ba25ad93737979e14",
      "AWS_LAMBDA_FUNCTION_NAME": "xxxxx-xxxxx-xxxxx-xxxx",
      "AWS_LAMBDA_FUNCTION_MEMORY_SIZE": "128",
      "AWS_LAMBDA_FUNCTION_VERSION": "8",
      "_AWS_XRAY_DAEMON_ADDRESS": "999.999.99.9",
      "_AWS_XRAY_DAEMON_PORT": "2000",
      "AWS_XRAY_DAEMON_ADDRESS": "999.999.99.9:2000",
      "AWS_XRAY_CONTEXT_MISSING": "LOG_ERROR",
      "_X_AMZN_TRACE_ID": "Root=XXXXParent=12345xxxxxx;Sampled=0",
      "AWS_EXECUTION_ENV": "AWS_Lambda_nodejs8.10",
      "_HANDLER": "index.handler",
      "NODE_PATH": "/opt/nodejs/node8/node_modules:/opt/nodejs/node_modules:/var/runtime/node_modules:/var/runtime:/var/task:/var/runtime/node_modules",
      "AWS_ACCESS_KEY_ID": "XXXX",
      "AWS_SECRET_ACCESS_KEY": "XXXX",
      "AWS_SESSION_TOKEN": "XXXX"
    }

    使い所のありそうなもの

    • S3_PERSISTENCE_BUCKET: データの永続化に必須
    • LANG / TZ: I18N / L10N系で使えそうかも


    マネックス証券

    広告ここから
    広告ここまで
    Home
    Search
    Bookmark