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.601.tar.gz
(15.5 MB
view hashes)
Built Distribution
Close
Hashes for cdk_cr_constructs-2.1.601.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7862a27d38cb45106a4b55d3e9a3e18d96737e4fb575f90e256c97fd80d8f22c |
|
MD5 | 10b033114a1c78023fcafc64f3c33f7d |
|
BLAKE2b-256 | 484f1e59658df48fd74947af8c82c5823bb198d7aa8ced85a7c09d645ae1ba59 |
Close
Hashes for cdk_cr_constructs-2.1.601-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4bdae95d5cc83e1681fde4c6e3755f47b6b68ef91a4c15413ded469d7587147 |
|
MD5 | e7b6a38a7c2d6c7de3d3a06d588c4070 |
|
BLAKE2b-256 | e955157f70b1ee746d76f5d340f1f9939bbdef3deb2efad2ae36c0788d9718f1 |