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.462.tar.gz
(15.1 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.462.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a1b70c5d3737913080429f7bc2b0f5d57210668082c7543b85df00fa49f7a99 |
|
MD5 | 65c0149d2b633a8940f5d31ad5c9e9fd |
|
BLAKE2b-256 | a9a45c5cd820b90bd1e890e43f7a88d7d90a8b59dbfc66fb335aee5319c556b1 |
Close
Hashes for cdk_cr_constructs-2.1.462-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e037dec61c6af7b34642800f540ff11dbf9fd5e2a1bac288427b5e403a58c817 |
|
MD5 | 4ed75a7527713868b8a750e19c9915e8 |
|
BLAKE2b-256 | 5bdf6ec080021d2628e45cb95e6f02cabf3834c5140e1287fc3274c06ebfd942 |