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.371.tar.gz
(14.9 MB
view hashes)
Built Distribution
Close
Hashes for cdk-cr-constructs-2.1.371.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8f3456fbfd4dd04bdc5fa72bb6417ff3369619b12d93219150207bb9d68f8d3 |
|
MD5 | 9c4beff1efe7024f678a0e706b4d7437 |
|
BLAKE2b-256 | 2ab9eb4cd8e35bfba5719cdc4d87b3b5d1fac8eb146bf7329523a3e105c6f4c8 |
Close
Hashes for cdk_cr_constructs-2.1.371-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7343a7f5f043d8c48dd0d318a0267d762a293fd63cde0f269af10f018d229d19 |
|
MD5 | d5401f8b5eca36dfa0a0bf6cbfb3cb16 |
|
BLAKE2b-256 | 64365eb741464ebcf7d2761b6595bed8a3a87913a20c52c0df01eff86c516bf4 |