This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from aws_cdk import core | |
| from aws_cdk import aws_s3 as s3 | |
| class MyS3Bucket(core.Construct): | |
| def __init__(self, scope: core.Construct, id: str): | |
| super().__init__(scope, id) | |
| bucket = s3.Bucket( | |
| self, "MyBucket", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as cdk from 'aws-cdk-lib'; | |
| import * as ec2 from 'aws-cdk-lib/aws-ec2'; | |
| import * as ecs from 'aws-cdk-lib/aws-ecs'; | |
| import * as ecs_patterns from 'aws-cdk-lib/aws-ecs-patterns'; | |
| interface EcsFargateServiceProps { | |
| vpc: ec2.IVpc; | |
| } | |
| export class EcsFargateService extends cdk.Construct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from aws_cdk import core as cdk | |
| from aws_cdk import aws_ec2 as ec2 | |
| class MyVpc(cdk.Construct): | |
| def __init__(self, scope: cdk.Construct, id: str, max_azs: int, **kwargs) -> None: | |
| super().__init__(scope, id, **kwargs) | |
| # Create VPC | |
| self.vpc = ec2.Vpc(self, "MyVpc", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as cdk from 'aws-cdk-lib'; | |
| import * as ec2 from 'aws-cdk-lib/aws-ec2'; | |
| export class MyVpcStack extends cdk.Stack { | |
| constructor(scope: cdk.Construct, id: string) { | |
| super(scope, id); | |
| const vpc = new ec2.Vpc(this, 'MyVpc', { | |
| cidr: '10.0.0.0/16', | |
| maxAzs: 2, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from aws_cdk import core | |
| from aws_cdk import aws_ec2 as ec2 | |
| app = core.App() | |
| stack = core.Stack(app, "MyStack") | |
| vpc = ec2.CfnVPC( | |
| stack, "MyVPC", | |
| cidr_block="10.0.0.0/16", | |
| enable_dns_support=True, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as cdk from 'aws-cdk-lib'; | |
| import * as ec2 from 'aws-cdk-lib/aws-ec2'; | |
| export class MyVpcStack extends cdk.Stack { | |
| constructor(scope: cdk.Construct, id: string) { | |
| super(scope, id); | |
| const vpc = new ec2.CfnVPC(this, 'MyVpc', { | |
| cidrBlock: '10.0.0.0/16', | |
| enableDnsHostnames: true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| AWSTemplateFormatVersion: '2010-09-09' | |
| Resources: | |
| MyVpc: | |
| Type: 'AWS::EC2::VPC' | |
| Properties: | |
| CidrBlock: '10.0.0.0/16' | |
| EnableDnsHostnames: true | |
| EnableDnsSupport: true | |
| Tags: |