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.529.tar.gz
(15.4 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.529.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | def83cf46cd6948e3332ed474603aae9619c18ef607b553566cf3a9fd4c1766c |
|
MD5 | b08f0ecd9bcbf88623c4af47a1eec77a |
|
BLAKE2b-256 | e8a1adedfa537b770631abae655b66b4388a5aa55aa21b92396e42511e76c74b |
Close
Hashes for cdk_cr_constructs-2.1.529-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf59c07d3ade7317f1684826295aa2615798d9992c597e440161ea07dc54f712 |
|
MD5 | 6f3f306690b33305b9e79c5779690baf |
|
BLAKE2b-256 | 24571197d28a34d37bc80a4595d28f24b4124ac292c1dae35316c35a46ffd6ad |