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.455.tar.gz
(15.2 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.455.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3d1f8a0110520526003b457c90952a42a5a94c3ed473d82ebcc2233682134ae |
|
MD5 | 986b2a956dfa434b78ad88c228a5ed4d |
|
BLAKE2b-256 | 9d250dd4b1b148ac3ccb42ddd5b22b4962ad92cba829ed47894b1326c6c40644 |
Close
Hashes for cdk_cr_constructs-2.1.455-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2a1dd198ae7c4c6c3b72ab496e47705257a8dbcb72e8797ffc700caa91a3cd0 |
|
MD5 | b501a47c4d79dd86456d81fb03bebef7 |
|
BLAKE2b-256 | 0e17b1debc69bfd3f575a4c535a9306abdd4388c244c1df338f947937426e155 |