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.567.tar.gz
(15.5 MB
view hashes)
Built Distribution
Close
Hashes for cdk_cr_constructs-2.1.567.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbe8fb12c91db78e6eb988707ba6d15c84a43fb8739c6d63b7f186b35442f45d |
|
MD5 | 62a8aad96a8ef6530dbe229b5f2aa178 |
|
BLAKE2b-256 | 7126092053131fe8a23db632184362152123e5c91dbe1e58d37f43bde9b6ca90 |
Close
Hashes for cdk_cr_constructs-2.1.567-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3eb1dd2edbefb66aefe56cd8f81ee543644b70d467a3dbddbfc84d432fd18903 |
|
MD5 | 80ae075f24d0194a255707643e5b8a65 |
|
BLAKE2b-256 | 497ee5e362964a8291177025a78ddb33bce393fb248d2a39097d38f37f519f05 |