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.475.tar.gz
(15.1 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.475.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2703a9b541780ad4c7ed20b37c4c28dd376fe4157824cfbc656c5c09d94ba29b |
|
MD5 | 5da00fadd0fc3ab408ac01a73f1ae1f1 |
|
BLAKE2b-256 | 16fe1418a539bc28fba4bfbf36cf0750717586d9eb0c6f9fbbb81aecd350a010 |
Close
Hashes for cdk_cr_constructs-2.1.475-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5fb6d6988c3feac1d1f559085b225de6164b2213a8423c392c3dacd78e8b0eb |
|
MD5 | a0ccd875e346fd9f94995888f5706fbd |
|
BLAKE2b-256 | 824972f265e696967465a8534063b6632cf62bf2388258533a2ededffd4280cc |