{"_id":"@aws-cdk/rtv","_rev":"5-6ab35440445d676bfeff636663b160c1","name":"@aws-cdk/rtv","dist-tags":{"latest":"0.8.0"},"versions":{"0.8.0":{"name":"@aws-cdk/rtv","version":"0.8.0","description":"Runtime values support for the AWS CDK","main":"lib/index.js","types":"lib/index.d.ts","jsii":{"outdir":"dist","targets":{"java":{"package":"com.amazonaws.cdk.rtv","maven":{"groupId":"com.amazonaws.cdk","artifactId":"rtv"}},"dotnet":{"namespace":"Amazon.CDK.RTV"}}},"repository":{"type":"git","url":"git://github.com/awslabs/aws-cdk.git"},"scripts":{"build":"cdk-build","watch":"cdk-watch","lint":"cdk-lint","test":"cdk-test","pkglint":"pkglint -f","integ":"cdk-integ"},"keywords":["aws","cdk","rtv"],"author":{"name":"Amazon Web Services","url":"https://aws.amazon.com"},"license":"Apache-2.0","devDependencies":{"@aws-cdk/assert":"^0.8.0+bb95676","@aws-cdk/aws-ec2":"^0.8.0+bb95676","@aws-cdk/aws-lambda":"^0.8.0+bb95676","@aws-cdk/aws-sqs":"^0.8.0+bb95676","cdk-build-tools":"^0.8.0+bb95676","cdk-integ-tools":"^0.8.0+bb95676","pkglint":"^0.8.0+bb95676"},"dependencies":{"@aws-cdk/aws-iam":"^0.8.0+bb95676","@aws-cdk/aws-ssm":"^0.8.0+bb95676","@aws-cdk/cdk":"^0.8.0+bb95676"},"_resolved":"","_integrity":"","_from":"file:/var/folders/n2/6v4_tbz97ws0h4bn5gbyvzb0m8vcjb/T/tmp.RsFoCAtz/y/npm/@aws-cdk/rtv/rtv-0.8.0.tgz","bugs":{"url":"https://github.com/awslabs/aws-cdk/issues"},"homepage":"https://github.com/awslabs/aws-cdk#readme","_id":"@aws-cdk/rtv@0.8.0","_npmVersion":"6.1.0","_nodeVersion":"8.9.4","_npmUser":{"name":"eladb","email":"elad.benisrael@gmail.com"},"dist":{"integrity":"sha512-EjKFFR60QjMhz0bvLKCWe/HZF+v98ps7dIwIeJy7K8L/s7jADm8u6GpJlOXEwqINwNM7vYgLghlcLojP0P4yUA==","shasum":"9ec04119b1f5a96e0601d0666a107bd77acb4d6e","tarball":"https://registry.npmjs.org/@aws-cdk/rtv/-/rtv-0.8.0.tgz","fileCount":17,"unpackedSize":66055,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbYGdXCRA9TVsSAnZWagAAUE0P/02Y2/34IybZfWs/Tjs4\nZSv58aIxvJvNzmWo06odft7xywCz4PIWHpNBY23QxHZ+/xoCQx7UW1XNDCs3\nm9qAySkRKGEZcL8r1uCnTNeOQyhm86J5dtXwUSLPh3GGgetoQYMLNxRy5T4a\nfnK7IysPict1DfiTbD9ncF6hoAq8DIllbqDD0+qbfjS77gN/OAGNFwjPSKao\nYh+nIfP+kAImsdBIHmmdG/qFrKn0TxkaLnzD0p6/vff5ZeSSMwl5PZ6efDLZ\noY1LMJyPCzExnUm1GsJeQJkrgUM1/HG1JEck9Mnlhuj/l0SoLa9KKR+9tsBr\nAxapryUyLnv4IejbuC2cW9b9cZzf92ipAKa1XN1mDUoKih+cSYjbJj8yAPqK\n//NCNPwtnlaKCehi75LkRG3xSibEB9AQQ5ePf6Hjf4lZ5LxPOjU+NbRsW/Vy\nWyErLffRZRvI8qe6vSqApQr0PQ26OltQaeH11RqNbdWfWPkXe1OdR44ElYUx\nC1QzVNG1pckl9PienZAh7CU8Yh0nmx+rC+zE8vgqHaLNBnNecs5un3L8xaJ6\nhjVfahZpTwnZlHxSBQ/LC7JHz4NKsWqLfULJvnfKLKxL47F9wl+Spp6RpE0g\n4rHpKcssoEYXBQyqEZAOxvWiz1+uZkO1RyHfVuOSVqp9xZF7CvK5qVMBUF3B\nfSOV\r\n=EKZM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDSdU0bsN3vcjeWlzU8/kmrQvHfJ6kCH+9GvQ319AXA/wIgFFdoxLVLojUZ3YrTR6fyoE0/XJMjzXH2lWjj+kRXT+Q="}]},"maintainers":[{"name":"amzn-oss","email":"osa-3p@amazon.com"},{"name":"eladb","email":"elad.benisrael@gmail.com"},{"name":"romainmuller","email":"romain.muller@telecomnancy.net"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rtv_0.8.0_1533044567471_0.02135177199497096"},"_hasShrinkwrap":false}},"time":{"created":"2018-07-31T13:42:47.436Z","0.8.0":"2018-07-31T13:42:47.938Z","modified":"2023-11-21T10:17:29.947Z"},"maintainers":[{"email":"osa-3p@amazon.com","name":"amzn-oss"},{"email":"aws-cdk-dev@amazon.com","name":"aws-cdk-team"}],"description":"Runtime values support for the AWS CDK","homepage":"https://github.com/awslabs/aws-cdk#readme","keywords":["aws","cdk","rtv"],"repository":{"type":"git","url":"git://github.com/awslabs/aws-cdk.git"},"author":{"name":"Amazon Web Services","url":"https://aws.amazon.com"},"bugs":{"url":"https://github.com/awslabs/aws-cdk/issues"},"license":"Apache-2.0","readme":"## Runtime Values\n\nThe CDK allows apps to advertise values from __construction time__ to __runtime\ncode__. For example, consider code in a Lambda function which needs to know the\nURL of the SQS queue created as part of your CDK app.\n\nRuntime values are advertised as textual SSM parameters with the following key:\n\n```\n/rtv/<stack-name>/<package>/<name>\n```\n\nTherefore, in order to advertise a value you will need to:\n\n1. Make the current stack name available as an environment variable to your\n   runtime code. The convention is to use `RTV_STACK_NAME`.\n2. Use the `RuntimeValue` construct in order to create the SSM parameter and\n   specify least-privilege permissions.\n\nFor example, say we want to publish a queue's URL to a lambda function.\n\n### Construction Code\n\n```ts\nimport { RuntimeValue } from '@aws-cdk/rtv'\n\nconst queue = new Queue(this, 'MyQueue', { /* props.... */ });\nconst fn = new Lambda(this, 'MyFunction', { /* props... */ });\nconst fleet = new Fleet(this, 'MyFleet', { /* props... */ });\n\n// this line defines an AWS::SSM::Parameter resource with the\n// key \"/rtv/<stack-name>/com.myorg/MyQueueURL\" and the actual queue URL as value\nconst queueUrlRtv = new RuntimeValue(this, 'QueueRTV', {\n    package: 'com.myorg',\n    name: 'MyQueueURL',\n    value: queue.queueUrl\n});\n\n// this line adds read permissions for this SSM parameter to the policies associated with\n// the IAM roles of the Lambda function and the EC2 fleet\nqueueUrlRtv.grantRead(fn.role);\nqueueUrlRtv.grantRead(fleet.role);\n\n// adds the `RTV_STACK_NAME` to the environment of the lambda function\n// and the fleet (via user-data)\nfn.env(RuntimeValue.ENV_NAME, RuntimeValue.ENV_VALUE);\nfleet.env(RuntimeValue.ENV_NAME, RuntimeValue.ENV_VALUE);\n```\n\n### Runtime Code\n\nThen, your runtime code will need to use the SSM Parameter Store AWS SDK in\norder to format the SSM parameter key and read the value. In future releases, we\nwill provide runtime libraries to make this easy.\n","readmeFilename":"README.md"}