aws cdk library for custom resource constructs.
Project description
cdk-cr-constructs
This Construct is collect custom resource
Example for CustomResourceGetEIP
import { App, Stack, CfnOutput, Duration, aws_iam } from 'aws-cdk-lib';
import { CustomResourceGetEIP } from 'cdk-cr-constructs';
const env = {
region: process.env.CDK_DEFAULT_REGION,
account: process.env.CDK_DEFAULT_ACCOUNT,
};
const app = new App();
const stack = new Stack(app, 'testing-stack', { env });
const getIps = new CustomResourceGetEIP(stack, 'CustomResourceGetEIP', {
/**
* Discovery us-east-1 Elastic Ips.
*/
regions: ['us-east-1'],
/**
* Add Company Ips.
*/
companyIps: ['1.2.3.4'],
});
const role = new aws_iam.Role(stack, 'DemoRole', {
assumedBy: new aws_iam.AccountRootPrincipal(),
});
/**
* Example create an assume role, allow all action from ip address.
*/
role.addToPolicy(new aws_iam.PolicyStatement({
effect: aws_iam.Effect.ALLOW,
resources: ['*'],
actions: ['*'],
conditions: {
IpAddress: {
'aws:SourceIp': getIps.ipList(),
},
},
}));
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cdk-cr-constructs-2.1.508.tar.gz
(15.3 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.508.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b7744a70ef2f236b6ba53ef7fd10a5a7aa6c6a49d3fd1278b7601aeb4a685b5 |
|
MD5 | b842916ab5587a79fe3393660af985e5 |
|
BLAKE2b-256 | 9b5d2ee312f1adc36ed177217f913041d86d5211236e2444ce1b5a34b957ccaa |
Close
Hashes for cdk_cr_constructs-2.1.508-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d58b4c147f84303a9840e3887fc21cfbd2fe605db155c0d5165360474939a73d |
|
MD5 | d8a9430287bb45833ee2a309d0350016 |
|
BLAKE2b-256 | 3a84a05517aac892f1739ac119403cca11d12f46c8e5a868e0c8c7e7eaa42ded |