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.587.tar.gz
(15.5 MB
view hashes)
Built Distribution
Close
Hashes for cdk_cr_constructs-2.1.587.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1340cab85f5ae8765bf77f7290833235ab827a989f8c8635c7064c5975cef5be |
|
MD5 | cca7ed2cf3be9951569f0158f7124312 |
|
BLAKE2b-256 | a9e67171ae66a4d8355a707ebe8a124abba9744b3d0b3afa5c539c6a870cfb44 |
Close
Hashes for cdk_cr_constructs-2.1.587-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3c4a0768aa088da41835e58d36a1ebf69a945ff49cfdef7e5359db3d3acd264 |
|
MD5 | 6ca19fff901b292e294e6d92ba73ee33 |
|
BLAKE2b-256 | e931f6ba4df98f3d9c4992078ae876733db30ed514e937fcb768f1f2c656398a |