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.596.tar.gz
(15.5 MB
view hashes)
Built Distribution
Close
Hashes for cdk_cr_constructs-2.1.596.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc0b3fba7610ae3efdc4df1146b0cd7297f1a0e8993dfecd2fd8001dff479f15 |
|
MD5 | 193ffe9f197cde62dfa5d791356edece |
|
BLAKE2b-256 | 40d1da8f418de5dd6a58e4f9e66b76d0f3cce10b9f0a6bb06abc6987cc176c69 |
Close
Hashes for cdk_cr_constructs-2.1.596-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0889d745830bc0ceacd6a4157fc7b373d1391ded409020cab203dbeccd85230f |
|
MD5 | 6d816ef86331e6a226054617f8d66b8c |
|
BLAKE2b-256 | 7fdb13d47d0cebfc2e2fb0641cbac5f92e1c00b95fb35e4b041729a068cf3606 |