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.377.tar.gz
(15.0 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.377.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e92d05dbb5446a23b8752b320296030a3801e4f919082e31c73b6a06ade2d43 |
|
MD5 | 0dd83612fa86e2910e1e71a1899bfa55 |
|
BLAKE2b-256 | feb4f890104bb2fca59923d5add4a78964cd9f6b7f152d10d11deac6a50cde9f |
Close
Hashes for cdk_cr_constructs-2.1.377-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae953b824e4a6928d6ee3aa3139ac19f0f6ebadc199ea59526ae696a227edb4d |
|
MD5 | 98c4cd2e0b17247c6755811446d996eb |
|
BLAKE2b-256 | 47c58dcc6a269fde0450135d13b9b0a3f4e5ebe2cb47ced0abf767039b63ec29 |