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.470.tar.gz
(15.1 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.470.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 307fc73f7066bd48c85f046119af3cdb74b13a55cf120743b7b2a8b54a71a8a9 |
|
MD5 | 1170bcde9aef91f984f1caa285b04af0 |
|
BLAKE2b-256 | a446c1fb77e0a7cf276c4e01655b929d3fd0d8a862b755190171ad4ec3e594a6 |
Close
Hashes for cdk_cr_constructs-2.1.470-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ce09c29c6f175b3620deac6569344066e86c6a615007a5afd489c06b753f8ab |
|
MD5 | 8c3d512a829107f42c93caaf151c4741 |
|
BLAKE2b-256 | b25a4d0d94f6373ada4ff5101e78bf4c5d79e878f44694dfb91ef177e5ba2d0b |