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.556.tar.gz
(15.4 MB
view hashes)
Built Distribution
Close
Hashes for cdk_cr_constructs-2.1.556.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e23533ae6353b29818ee684268d13d4873632d0ff6550fe79cc7417fe418deca |
|
MD5 | c0970a632f90edd0cd7e93cf7cc95af0 |
|
BLAKE2b-256 | 016e563a8a8c6bed5ec3c1851726613f0ac662f5868df760a197ce046471d2e3 |
Close
Hashes for cdk_cr_constructs-2.1.556-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8ba4fccbc67a91b2a43e1ebb13bfd68d43ac3736f4f8f7f3d043a5bb2aaabb7 |
|
MD5 | 9c563e0744cc2df51280dbd17208a384 |
|
BLAKE2b-256 | de6d1d23fbe82200e99094448c6ef7674ad65666e40d014fb59edfee27016d48 |