@faridnsh/cdk-ssm-parameters-cross-region
v0.0.527
Published
Store, read and lookup AWS SSM Parameters cross-region
Downloads
356
Maintainers
Readme
CDK SSM Parameters cross-region
What this fork adds
Compared with the original @pepperize/cdk-ssm-parameters-cross-region, this fork adds:
StringParameter.fromStringParameterArnfor ARN-based reads, including cross-account parameters shared through AWS RAM.- Least-privilege IAM policies for all custom-resource SSM calls. Reads, creates, updates, and deletes are restricted to the exact parameter ARN instead of
Resource: "*".
Store, read and lookup AWS SSM Parameters cross-region
Currently, only supports StringParameter except simple name. Implements
aws_ssm.IParameterand can be used asaws_ssm.StringParameterreplacement.
Install
TypeScript
npm install @faridnsh/cdk-ssm-parameters-cross-regionor
yarn add @faridnsh/cdk-ssm-parameters-cross-regionUsage
Store AWS SSM Parameter cross-region
import { StringParameter } from "@faridnsh/cdk-ssm-parameters-cross-region";
new StringParameter(scope, "PutParameter", {
region: "eu-central-1",
parameterName: "/path/name/example",
stringValue: "Say hello from another region",
});See StringParameter
Read AWS SSM Parameter cross-region
import { StringParameter } from "@faridnsh/cdk-ssm-parameters-cross-region";
StringParameter.fromStringParameterName(scope, "GetParameter", "eu-central-1", "/path/name/example");Import AWS SSM Parameter cross-region by ARN
import { StringParameter } from "@faridnsh/cdk-ssm-parameters-cross-region";
const arn = Stack.of(scope).formatArn({
service: "ssm",
resource: `parameter/path/name/example`,
region: "eu-central-1",
account: "123456789012",
});
StringParameter.fromStringParameterArn(scope, "GetByArn", arn);Cross-account reads require an Advanced-tier SSM parameter shared with the reading account through AWS Resource Access Manager (AWS RAM). The full shared parameter ARN is sent to GetParameter; no assumed role is required by this construct.
Lookup AWS SSM Parameter cross-region
import { StringParameter } from "@faridnsh/cdk-ssm-parameters-cross-region";
StringParameter.valueFromLookup(scope, "eu-central-1", "/path/name/example");