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.344.tar.gz
(13.9 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.344.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e56aecf242cf2c96a25e5a7744a72dbe5f4ce33c82d1ce5c18204de01d50d3da |
|
MD5 | b6f973550a86d58fd5a6e999f2a4826c |
|
BLAKE2b-256 | ef58167a5b2fa61db430417f88963767f515389656970a7ca7ce69fd42096261 |
Close
Hashes for cdk_cr_constructs-2.1.344-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a8a62b3fa8d8ad36948991b7a9d736907f33c904e685c9474c241ef7f684e06 |
|
MD5 | 8d379f5abf4e12da6b4b4bc3da475fbf |
|
BLAKE2b-256 | 6c8b4be3324fee725b50466a9f7a0b0c82473c6bd173c24c2bc2b194b2e0a308 |