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.547.tar.gz
(15.4 MB
view hashes)
Built Distribution
Close
Hashes for cdk_cr_constructs-2.1.547.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c56b48e316d8312b4fb50bc9adcf5611233f932d5b10b9d90f5e9057190d93b8 |
|
MD5 | 0c73334b1b9692f62a11ebfbb0d7cddd |
|
BLAKE2b-256 | f6bcd736648f0ee434bbfc607aa09a9e58a8840812277a11d34bf7cf5bf9dcaa |
Close
Hashes for cdk_cr_constructs-2.1.547-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b8e57f5f785419714164c169240d43a7eff965b7198244acba1d7e97e7acfdc |
|
MD5 | 5b3de6513d5188c8c18e05d03438bae1 |
|
BLAKE2b-256 | ff476e9d50ae382326fef89cd10cbf084f29f69775922a4fda57ba4fa9ed51ba |