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.569.tar.gz
(15.5 MB
view hashes)
Built Distribution
Close
Hashes for cdk_cr_constructs-2.1.569.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0da26ee92df2acae3715a6d1e33bafcbfb3290cd1fbf1a897ea44b05f0600d91 |
|
MD5 | aaefa4b35af38248f7db6ad3d9a55562 |
|
BLAKE2b-256 | d49eb4f2c1d777e685ef90eb5caabbf3d9bb1aac9daf3e3bec5ac082e7b84a83 |
Close
Hashes for cdk_cr_constructs-2.1.569-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b257f3c0eb2771b9b38196675629d2e04c0e5f431407ad7687c0f963b7e20f2 |
|
MD5 | 7a135268c053841f9056864968bbf241 |
|
BLAKE2b-256 | 868d9f6b5961033994006c861145ab4860b4d5dd145cbaff82a364cffb6a651d |