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.583.tar.gz
(15.5 MB
view hashes)
Built Distribution
Close
Hashes for cdk_cr_constructs-2.1.583.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 859f245792404afbb817b69a4cfe32f71c9b0f500fbdabc4568c656d54191f0f |
|
MD5 | 8a022893dc70a7cb829ec56768bc23cb |
|
BLAKE2b-256 | 56be73ed239b622a7b155fdbb3cb29c44380ef8f492504dc42498bb5fe8fe1f7 |
Close
Hashes for cdk_cr_constructs-2.1.583-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e67d0052872b1352fc1810a36b83e556061833e4398703a2cf74a741e4e3f7a |
|
MD5 | 9568bdcc4528059b0017dbcbb365c48c |
|
BLAKE2b-256 | ffae4667de337a2064b66c718aefda0544256a66ac29cbcc3c4df0e6e05cbabb |