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.457.tar.gz
(15.1 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.457.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a8102d933f7f9fa01c4be77fcc31a27a3bec0395aa5b3b2722d7ad7fda1fa27 |
|
MD5 | f79241c54681dcde51dbf3228f6426f5 |
|
BLAKE2b-256 | 38f3e086ad09e12067540cab4a37ec452cc7ae9136c2e27cf5e886991cf0a3a8 |
Close
Hashes for cdk_cr_constructs-2.1.457-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20f213ffdc101b02ffd63f63c3f918f5ed8ff57c1fce6d92edb5d01f40b44645 |
|
MD5 | fae6aa234e942a2e57712af9b9508d26 |
|
BLAKE2b-256 | 2c3291df3398063149bbf9a75bee712c47a5a49517df0648e613212e48f95a6d |