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.430.tar.gz
(15.1 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.430.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b6c02099c87427e2d08843947d340b6814077d8a087387b8eba4e37747c37c1 |
|
MD5 | ceb1a4e0301ffe5fdf35308a22e583d6 |
|
BLAKE2b-256 | d9e12df10fdff64998460656e88599a030add8d13e96494e4013537238f54253 |
Close
Hashes for cdk_cr_constructs-2.1.430-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89940c365744b0dddec29cea2072e7e09afa6930fd13b47d664e0e679a0f8743 |
|
MD5 | 66db0655178422ea2a1856237f053bc0 |
|
BLAKE2b-256 | e82cd42b2ba2e3bdc9a3315f7d49a0d8b70a4b11427d63623e0897797613b5e1 |