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.551.tar.gz
(15.4 MB
view hashes)
Built Distribution
Close
Hashes for cdk_cr_constructs-2.1.551.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35c4a4f0c38eb8f53ed749cf25d6e52275698831cc13910143e4ff46e09ac9f9 |
|
MD5 | 427ef4bab0fb4b93e6087490f799cf7f |
|
BLAKE2b-256 | b7241e7512bd0899e11e22ac0754c7db814997e1a3b978b8a7bb76bbe85f1ee5 |
Close
Hashes for cdk_cr_constructs-2.1.551-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28cdb1371058d8f2dafaa1562f090a2f19ad231fa122c0f2647fe6277f2c9a3b |
|
MD5 | c99a43f0c3f6728962e45f9cf83b6a25 |
|
BLAKE2b-256 | ed1d1513edad0c463a7a2e9c4c249947a680749476fa57f9331d1f1fac82bcb9 |