@aws-cdk/aws-ecs
Version:
The CDK Construct Library for AWS::ECS
661 lines • 1.69 MB
JSON
{
"version": "2",
"toolVersion": "1.74.0",
"snippets": {
"c9c6a8c88b4fb7be990cedb097c2f2aa75160427b4dacd11ef3f72821155191d": {
"translations": {
"python": {
"source": "# vpc: ec2.Vpc\n\n\n# Create an ECS cluster\ncluster = ecs.Cluster(self, \"Cluster\",\n vpc=vpc\n)\n\n# Add capacity to it\ncluster.add_capacity(\"DefaultAutoScalingGroupCapacity\",\n instance_type=ec2.InstanceType(\"t2.xlarge\"),\n desired_capacity=3\n)\n\ntask_definition = ecs.Ec2TaskDefinition(self, \"TaskDef\")\n\ntask_definition.add_container(\"DefaultContainer\",\n image=ecs.ContainerImage.from_registry(\"amazon/amazon-ecs-sample\"),\n memory_limit_mi_b=512\n)\n\n# Instantiate an Amazon ECS Service\necs_service = ecs.Ec2Service(self, \"Service\",\n cluster=cluster,\n task_definition=task_definition\n)",
"version": "2"
},
"csharp": {
"source": "Vpc vpc;\n\n\n// Create an ECS cluster\nCluster cluster = new Cluster(this, \"Cluster\", new ClusterProps {\n Vpc = vpc\n});\n\n// Add capacity to it\ncluster.AddCapacity(\"DefaultAutoScalingGroupCapacity\", new AddCapacityOptions {\n InstanceType = new InstanceType(\"t2.xlarge\"),\n DesiredCapacity = 3\n});\n\nEc2TaskDefinition taskDefinition = new Ec2TaskDefinition(this, \"TaskDef\");\n\ntaskDefinition.AddContainer(\"DefaultContainer\", new ContainerDefinitionOptions {\n Image = ContainerImage.FromRegistry(\"amazon/amazon-ecs-sample\"),\n MemoryLimitMiB = 512\n});\n\n// Instantiate an Amazon ECS Service\nEc2Service ecsService = new Ec2Service(this, \"Service\", new Ec2ServiceProps {\n Cluster = cluster,\n TaskDefinition = taskDefinition\n});",
"version": "1"
},
"java": {
"source": "Vpc vpc;\n\n\n// Create an ECS cluster\nCluster cluster = Cluster.Builder.create(this, \"Cluster\")\n .vpc(vpc)\n .build();\n\n// Add capacity to it\ncluster.addCapacity(\"DefaultAutoScalingGroupCapacity\", AddCapacityOptions.builder()\n .instanceType(new InstanceType(\"t2.xlarge\"))\n .desiredCapacity(3)\n .build());\n\nEc2TaskDefinition taskDefinition = new Ec2TaskDefinition(this, \"TaskDef\");\n\ntaskDefinition.addContainer(\"DefaultContainer\", ContainerDefinitionOptions.builder()\n .image(ContainerImage.fromRegistry(\"amazon/amazon-ecs-sample\"))\n .memoryLimitMiB(512)\n .build());\n\n// Instantiate an Amazon ECS Service\nEc2Service ecsService = Ec2Service.Builder.create(this, \"Service\")\n .cluster(cluster)\n .taskDefinition(taskDefinition)\n .build();",
"version": "1"
},
"go": {
"source": "var vpc vpc\n\n\n// Create an ECS cluster\ncluster := ecs.NewCluster(this, jsii.String(\"Cluster\"), &clusterProps{\n\tvpc: vpc,\n})\n\n// Add capacity to it\ncluster.addCapacity(jsii.String(\"DefaultAutoScalingGroupCapacity\"), &addCapacityOptions{\n\tinstanceType: ec2.NewInstanceType(jsii.String(\"t2.xlarge\")),\n\tdesiredCapacity: jsii.Number(3),\n})\n\ntaskDefinition := ecs.NewEc2TaskDefinition(this, jsii.String(\"TaskDef\"))\n\ntaskDefinition.addContainer(jsii.String(\"DefaultContainer\"), &containerDefinitionOptions{\n\timage: ecs.containerImage.fromRegistry(jsii.String(\"amazon/amazon-ecs-sample\")),\n\tmemoryLimitMiB: jsii.Number(512),\n})\n\n// Instantiate an Amazon ECS Service\necsService := ecs.NewEc2Service(this, jsii.String(\"Service\"), &ec2ServiceProps{\n\tcluster: cluster,\n\ttaskDefinition: taskDefinition,\n})",
"version": "1"
},
"$": {
"source": "declare const vpc: ec2.Vpc;\n\n// Create an ECS cluster\nconst cluster = new ecs.Cluster(this, 'Cluster', {\n vpc,\n});\n\n// Add capacity to it\ncluster.addCapacity('DefaultAutoScalingGroupCapacity', {\n instanceType: new ec2.InstanceType(\"t2.xlarge\"),\n desiredCapacity: 3,\n});\n\nconst taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef');\n\ntaskDefinition.addContainer('DefaultContainer', {\n image: ecs.ContainerImage.fromRegistry(\"amazon/amazon-ecs-sample\"),\n memoryLimitMiB: 512,\n});\n\n// Instantiate an Amazon ECS Service\nconst ecsService = new ecs.Ec2Service(this, 'Service', {\n cluster,\n taskDefinition,\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-ecs"
},
"field": {
"field": "markdown",
"line": 25
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-ec2.IVpc",
"@aws-cdk/aws-ec2.InstanceType",
"@aws-cdk/aws-ecs.AddCapacityOptions",
"@aws-cdk/aws-ecs.Cluster",
"@aws-cdk/aws-ecs.Cluster#addCapacity",
"@aws-cdk/aws-ecs.ClusterProps",
"@aws-cdk/aws-ecs.ContainerDefinitionOptions",
"@aws-cdk/aws-ecs.ContainerImage",
"@aws-cdk/aws-ecs.ContainerImage#fromRegistry",
"@aws-cdk/aws-ecs.Ec2Service",
"@aws-cdk/aws-ecs.Ec2ServiceProps",
"@aws-cdk/aws-ecs.Ec2TaskDefinition",
"@aws-cdk/aws-ecs.ICluster",
"@aws-cdk/aws-ecs.TaskDefinition",
"@aws-cdk/aws-ecs.TaskDefinition#addContainer",
"constructs.Construct"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const vpc: ec2.Vpc;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { SecretValue, Stack } from '@aws-cdk/core';\nimport autoscaling = require('@aws-cdk/aws-autoscaling');\nimport cloudmap = require('@aws-cdk/aws-servicediscovery');\nimport ecs = require('@aws-cdk/aws-ecs');\nimport ec2 = require('@aws-cdk/aws-ec2');\nimport elb = require('@aws-cdk/aws-elasticloadbalancing');\nimport elbv2 = require('@aws-cdk/aws-elasticloadbalancingv2');\nimport events = require('@aws-cdk/aws-events');\nimport kms = require('@aws-cdk/aws-kms');\nimport logs = require('@aws-cdk/aws-logs');\nimport s3 = require('@aws-cdk/aws-s3');\nimport secretsmanager = require('@aws-cdk/aws-secretsmanager');\nimport ssm = require('@aws-cdk/aws-ssm');\nimport targets = require('@aws-cdk/aws-events-targets');\nimport path = require('path');\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\n// Create an ECS cluster\nconst cluster = new ecs.Cluster(this, 'Cluster', {\n vpc,\n});\n\n// Add capacity to it\ncluster.addCapacity('DefaultAutoScalingGroupCapacity', {\n instanceType: new ec2.InstanceType(\"t2.xlarge\"),\n desiredCapacity: 3,\n});\n\nconst taskDefinition = new ecs.Ec2TaskDefinition(this, 'TaskDef');\n\ntaskDefinition.addContainer('DefaultContainer', {\n image: ecs.ContainerImage.fromRegistry(\"amazon/amazon-ecs-sample\"),\n memoryLimitMiB: 512,\n});\n\n// Instantiate an Amazon ECS Service\nconst ecsService = new ecs.Ec2Service(this, 'Service', {\n cluster,\n taskDefinition,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
"syntaxKindCounter": {
"8": 2,
"10": 7,
"75": 28,
"104": 3,
"130": 1,
"153": 1,
"169": 1,
"193": 4,
"194": 8,
"196": 3,
"197": 4,
"225": 4,
"226": 2,
"242": 4,
"243": 4,
"281": 4,
"282": 3,
"290": 1
},
"fqnsFingerprint": "3e7a584768aedabc6e65dd57722ebd947f0014ebe561bae3cbd75a7777c18cba"
},
"b3dac31f45ff994dbec7c0d5143e78caf2e31c19670a2aa03606cabaeae774c1": {
"translations": {
"python": {
"source": "# vpc: ec2.Vpc\n\n\ncluster = ecs.Cluster(self, \"Cluster\",\n vpc=vpc\n)",
"version": "2"
},
"csharp": {
"source": "Vpc vpc;\n\n\nCluster cluster = new Cluster(this, \"Cluster\", new ClusterProps {\n Vpc = vpc\n});",
"version": "1"
},
"java": {
"source": "Vpc vpc;\n\n\nCluster cluster = Cluster.Builder.create(this, \"Cluster\")\n .vpc(vpc)\n .build();",
"version": "1"
},
"go": {
"source": "var vpc vpc\n\n\ncluster := ecs.NewCluster(this, jsii.String(\"Cluster\"), &clusterProps{\n\tvpc: vpc,\n})",
"version": "1"
},
"$": {
"source": "declare const vpc: ec2.Vpc;\n\nconst cluster = new ecs.Cluster(this, 'Cluster', {\n vpc,\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-ecs"
},
"field": {
"field": "markdown",
"line": 91
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-ec2.IVpc",
"@aws-cdk/aws-ecs.Cluster",
"@aws-cdk/aws-ecs.ClusterProps",
"constructs.Construct"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const vpc: ec2.Vpc;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { SecretValue, Stack } from '@aws-cdk/core';\nimport autoscaling = require('@aws-cdk/aws-autoscaling');\nimport cloudmap = require('@aws-cdk/aws-servicediscovery');\nimport ecs = require('@aws-cdk/aws-ecs');\nimport ec2 = require('@aws-cdk/aws-ec2');\nimport elb = require('@aws-cdk/aws-elasticloadbalancing');\nimport elbv2 = require('@aws-cdk/aws-elasticloadbalancingv2');\nimport events = require('@aws-cdk/aws-events');\nimport kms = require('@aws-cdk/aws-kms');\nimport logs = require('@aws-cdk/aws-logs');\nimport s3 = require('@aws-cdk/aws-s3');\nimport secretsmanager = require('@aws-cdk/aws-secretsmanager');\nimport ssm = require('@aws-cdk/aws-ssm');\nimport targets = require('@aws-cdk/aws-events-targets');\nimport path = require('path');\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst cluster = new ecs.Cluster(this, 'Cluster', {\n vpc,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
"syntaxKindCounter": {
"10": 1,
"75": 7,
"104": 1,
"130": 1,
"153": 1,
"169": 1,
"193": 1,
"194": 1,
"197": 1,
"225": 2,
"242": 2,
"243": 2,
"282": 1,
"290": 1
},
"fqnsFingerprint": "cd7deef9b7dc0e852e95713e0435e2f1b8b79745499dbffd37dd0ccf93b45782"
},
"0aa974c1559781be7c1b1677dd4da586e52114e261982a87fe40d8e440ebe91d": {
"translations": {
"python": {
"source": "cluster_arn = \"arn:aws:ecs:us-east-1:012345678910:cluster/clusterName\"\n\ncluster = ecs.Cluster.from_cluster_arn(self, \"Cluster\", cluster_arn)",
"version": "2"
},
"csharp": {
"source": "string clusterArn = \"arn:aws:ecs:us-east-1:012345678910:cluster/clusterName\";\n\nICluster cluster = Cluster.FromClusterArn(this, \"Cluster\", clusterArn);",
"version": "1"
},
"java": {
"source": "String clusterArn = \"arn:aws:ecs:us-east-1:012345678910:cluster/clusterName\";\n\nICluster cluster = Cluster.fromClusterArn(this, \"Cluster\", clusterArn);",
"version": "1"
},
"go": {
"source": "clusterArn := \"arn:aws:ecs:us-east-1:012345678910:cluster/clusterName\"\n\ncluster := ecs.cluster.fromClusterArn(this, jsii.String(\"Cluster\"), clusterArn)",
"version": "1"
},
"$": {
"source": "const clusterArn = 'arn:aws:ecs:us-east-1:012345678910:cluster/clusterName';\n\nconst cluster = ecs.Cluster.fromClusterArn(this, 'Cluster', clusterArn);",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-ecs"
},
"field": {
"field": "markdown",
"line": 102
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-ecs.Cluster",
"@aws-cdk/aws-ecs.Cluster#fromClusterArn",
"@aws-cdk/aws-ecs.ICluster",
"constructs.Construct"
],
"fullSource": "// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { SecretValue, Stack } from '@aws-cdk/core';\nimport autoscaling = require('@aws-cdk/aws-autoscaling');\nimport cloudmap = require('@aws-cdk/aws-servicediscovery');\nimport ecs = require('@aws-cdk/aws-ecs');\nimport ec2 = require('@aws-cdk/aws-ec2');\nimport elb = require('@aws-cdk/aws-elasticloadbalancing');\nimport elbv2 = require('@aws-cdk/aws-elasticloadbalancingv2');\nimport events = require('@aws-cdk/aws-events');\nimport kms = require('@aws-cdk/aws-kms');\nimport logs = require('@aws-cdk/aws-logs');\nimport s3 = require('@aws-cdk/aws-s3');\nimport secretsmanager = require('@aws-cdk/aws-secretsmanager');\nimport ssm = require('@aws-cdk/aws-ssm');\nimport targets = require('@aws-cdk/aws-events-targets');\nimport path = require('path');\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst clusterArn = 'arn:aws:ecs:us-east-1:012345678910:cluster/clusterName';\n\nconst cluster = ecs.Cluster.fromClusterArn(this, 'Cluster', clusterArn);\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
"syntaxKindCounter": {
"10": 2,
"75": 6,
"104": 1,
"194": 2,
"196": 1,
"225": 2,
"242": 2,
"243": 2
},
"fqnsFingerprint": "640eb5a59470b50b6123ea6f9d70aa961ac8e0e3279fbdddf0c62a5c5accf81b"
},
"8430417a661796828b530ad96f46dffc2c9dadf923ba5f1771e28966dca94704": {
"translations": {
"python": {
"source": "# vpc: ec2.Vpc\n\n\ncluster = ecs.Cluster(self, \"Cluster\",\n vpc=vpc\n)\n\n# Either add default capacity\ncluster.add_capacity(\"DefaultAutoScalingGroupCapacity\",\n instance_type=ec2.InstanceType(\"t2.xlarge\"),\n desired_capacity=3\n)\n\n# Or add customized capacity. Be sure to start the Amazon ECS-optimized AMI.\nauto_scaling_group = autoscaling.AutoScalingGroup(self, \"ASG\",\n vpc=vpc,\n instance_type=ec2.InstanceType(\"t2.xlarge\"),\n machine_image=ecs.EcsOptimizedImage.amazon_linux(),\n # Or use Amazon ECS-Optimized Amazon Linux 2 AMI\n # machineImage: EcsOptimizedImage.amazonLinux2(),\n desired_capacity=3\n)\n\ncapacity_provider = ecs.AsgCapacityProvider(self, \"AsgCapacityProvider\",\n auto_scaling_group=auto_scaling_group\n)\ncluster.add_asg_capacity_provider(capacity_provider)",
"version": "2"
},
"csharp": {
"source": "Vpc vpc;\n\n\nCluster cluster = new Cluster(this, \"Cluster\", new ClusterProps {\n Vpc = vpc\n});\n\n// Either add default capacity\ncluster.AddCapacity(\"DefaultAutoScalingGroupCapacity\", new AddCapacityOptions {\n InstanceType = new InstanceType(\"t2.xlarge\"),\n DesiredCapacity = 3\n});\n\n// Or add customized capacity. Be sure to start the Amazon ECS-optimized AMI.\nAutoScalingGroup autoScalingGroup = new AutoScalingGroup(this, \"ASG\", new AutoScalingGroupProps {\n Vpc = vpc,\n InstanceType = new InstanceType(\"t2.xlarge\"),\n MachineImage = EcsOptimizedImage.AmazonLinux(),\n // Or use Amazon ECS-Optimized Amazon Linux 2 AMI\n // machineImage: EcsOptimizedImage.amazonLinux2(),\n DesiredCapacity = 3\n});\n\nAsgCapacityProvider capacityProvider = new AsgCapacityProvider(this, \"AsgCapacityProvider\", new AsgCapacityProviderProps {\n AutoScalingGroup = autoScalingGroup\n});\ncluster.AddAsgCapacityProvider(capacityProvider);",
"version": "1"
},
"java": {
"source": "Vpc vpc;\n\n\nCluster cluster = Cluster.Builder.create(this, \"Cluster\")\n .vpc(vpc)\n .build();\n\n// Either add default capacity\ncluster.addCapacity(\"DefaultAutoScalingGroupCapacity\", AddCapacityOptions.builder()\n .instanceType(new InstanceType(\"t2.xlarge\"))\n .desiredCapacity(3)\n .build());\n\n// Or add customized capacity. Be sure to start the Amazon ECS-optimized AMI.\nAutoScalingGroup autoScalingGroup = AutoScalingGroup.Builder.create(this, \"ASG\")\n .vpc(vpc)\n .instanceType(new InstanceType(\"t2.xlarge\"))\n .machineImage(EcsOptimizedImage.amazonLinux())\n // Or use Amazon ECS-Optimized Amazon Linux 2 AMI\n // machineImage: EcsOptimizedImage.amazonLinux2(),\n .desiredCapacity(3)\n .build();\n\nAsgCapacityProvider capacityProvider = AsgCapacityProvider.Builder.create(this, \"AsgCapacityProvider\")\n .autoScalingGroup(autoScalingGroup)\n .build();\ncluster.addAsgCapacityProvider(capacityProvider);",
"version": "1"
},
"go": {
"source": "var vpc vpc\n\n\ncluster := ecs.NewCluster(this, jsii.String(\"Cluster\"), &clusterProps{\n\tvpc: vpc,\n})\n\n// Either add default capacity\ncluster.addCapacity(jsii.String(\"DefaultAutoScalingGroupCapacity\"), &addCapacityOptions{\n\tinstanceType: ec2.NewInstanceType(jsii.String(\"t2.xlarge\")),\n\tdesiredCapacity: jsii.Number(3),\n})\n\n// Or add customized capacity. Be sure to start the Amazon ECS-optimized AMI.\nautoScalingGroup := autoscaling.NewAutoScalingGroup(this, jsii.String(\"ASG\"), &autoScalingGroupProps{\n\tvpc: vpc,\n\tinstanceType: ec2.NewInstanceType(jsii.String(\"t2.xlarge\")),\n\tmachineImage: ecs.ecsOptimizedImage.amazonLinux(),\n\t// Or use Amazon ECS-Optimized Amazon Linux 2 AMI\n\t// machineImage: EcsOptimizedImage.amazonLinux2(),\n\tdesiredCapacity: jsii.Number(3),\n})\n\ncapacityProvider := ecs.NewAsgCapacityProvider(this, jsii.String(\"AsgCapacityProvider\"), &asgCapacityProviderProps{\n\tautoScalingGroup: autoScalingGroup,\n})\ncluster.addAsgCapacityProvider(capacityProvider)",
"version": "1"
},
"$": {
"source": "declare const vpc: ec2.Vpc;\n\nconst cluster = new ecs.Cluster(this, 'Cluster', {\n vpc,\n});\n\n// Either add default capacity\ncluster.addCapacity('DefaultAutoScalingGroupCapacity', {\n instanceType: new ec2.InstanceType(\"t2.xlarge\"),\n desiredCapacity: 3,\n});\n\n// Or add customized capacity. Be sure to start the Amazon ECS-optimized AMI.\nconst autoScalingGroup = new autoscaling.AutoScalingGroup(this, 'ASG', {\n vpc,\n instanceType: new ec2.InstanceType('t2.xlarge'),\n machineImage: ecs.EcsOptimizedImage.amazonLinux(),\n // Or use Amazon ECS-Optimized Amazon Linux 2 AMI\n // machineImage: EcsOptimizedImage.amazonLinux2(),\n desiredCapacity: 3,\n // ... other options here ...\n});\n\nconst capacityProvider = new ecs.AsgCapacityProvider(this, 'AsgCapacityProvider', {\n autoScalingGroup,\n});\ncluster.addAsgCapacityProvider(capacityProvider);",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-ecs"
},
"field": {
"field": "markdown",
"line": 118
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-autoscaling.AutoScalingGroup",
"@aws-cdk/aws-autoscaling.AutoScalingGroupProps",
"@aws-cdk/aws-autoscaling.IAutoScalingGroup",
"@aws-cdk/aws-ec2.IMachineImage",
"@aws-cdk/aws-ec2.IVpc",
"@aws-cdk/aws-ec2.InstanceType",
"@aws-cdk/aws-ecs.AddCapacityOptions",
"@aws-cdk/aws-ecs.AsgCapacityProvider",
"@aws-cdk/aws-ecs.AsgCapacityProviderProps",
"@aws-cdk/aws-ecs.Cluster",
"@aws-cdk/aws-ecs.Cluster#addAsgCapacityProvider",
"@aws-cdk/aws-ecs.Cluster#addCapacity",
"@aws-cdk/aws-ecs.ClusterProps",
"@aws-cdk/aws-ecs.EcsOptimizedImage",
"@aws-cdk/aws-ecs.EcsOptimizedImage#amazonLinux",
"constructs.Construct"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const vpc: ec2.Vpc;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { SecretValue, Stack } from '@aws-cdk/core';\nimport autoscaling = require('@aws-cdk/aws-autoscaling');\nimport cloudmap = require('@aws-cdk/aws-servicediscovery');\nimport ecs = require('@aws-cdk/aws-ecs');\nimport ec2 = require('@aws-cdk/aws-ec2');\nimport elb = require('@aws-cdk/aws-elasticloadbalancing');\nimport elbv2 = require('@aws-cdk/aws-elasticloadbalancingv2');\nimport events = require('@aws-cdk/aws-events');\nimport kms = require('@aws-cdk/aws-kms');\nimport logs = require('@aws-cdk/aws-logs');\nimport s3 = require('@aws-cdk/aws-s3');\nimport secretsmanager = require('@aws-cdk/aws-secretsmanager');\nimport ssm = require('@aws-cdk/aws-ssm');\nimport targets = require('@aws-cdk/aws-events-targets');\nimport path = require('path');\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\nconst cluster = new ecs.Cluster(this, 'Cluster', {\n vpc,\n});\n\n// Either add default capacity\ncluster.addCapacity('DefaultAutoScalingGroupCapacity', {\n instanceType: new ec2.InstanceType(\"t2.xlarge\"),\n desiredCapacity: 3,\n});\n\n// Or add customized capacity. Be sure to start the Amazon ECS-optimized AMI.\nconst autoScalingGroup = new autoscaling.AutoScalingGroup(this, 'ASG', {\n vpc,\n instanceType: new ec2.InstanceType('t2.xlarge'),\n machineImage: ecs.EcsOptimizedImage.amazonLinux(),\n // Or use Amazon ECS-Optimized Amazon Linux 2 AMI\n // machineImage: EcsOptimizedImage.amazonLinux2(),\n desiredCapacity: 3,\n // ... other options here ...\n});\n\nconst capacityProvider = new ecs.AsgCapacityProvider(this, 'AsgCapacityProvider', {\n autoScalingGroup,\n});\ncluster.addAsgCapacityProvider(capacityProvider);\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
"syntaxKindCounter": {
"8": 2,
"10": 6,
"75": 32,
"104": 3,
"130": 1,
"153": 1,
"169": 1,
"193": 4,
"194": 9,
"196": 3,
"197": 5,
"225": 4,
"226": 2,
"242": 4,
"243": 4,
"281": 5,
"282": 3,
"290": 1
},
"fqnsFingerprint": "ae2235b7911b1583d38c930fb66794916f54f79b4bf7e228d205074f793147af"
},
"00471cdcbafcff42bd1b016db774055e9fb4a0c3ec03e93bc10e985be876d2f9": {
"translations": {
"python": {
"source": "# vpc: ec2.Vpc\n\nauto_scaling_group = autoscaling.AutoScalingGroup(self, \"ASG\",\n machine_image=ecs.EcsOptimizedImage.amazon_linux(cached_in_context=True),\n vpc=vpc,\n instance_type=ec2.InstanceType(\"t2.micro\")\n)",
"version": "2"
},
"csharp": {
"source": "Vpc vpc;\n\nAutoScalingGroup autoScalingGroup = new AutoScalingGroup(this, \"ASG\", new AutoScalingGroupProps {\n MachineImage = EcsOptimizedImage.AmazonLinux(new EcsOptimizedImageOptions { CachedInContext = true }),\n Vpc = vpc,\n InstanceType = new InstanceType(\"t2.micro\")\n});",
"version": "1"
},
"java": {
"source": "Vpc vpc;\n\nAutoScalingGroup autoScalingGroup = AutoScalingGroup.Builder.create(this, \"ASG\")\n .machineImage(EcsOptimizedImage.amazonLinux(EcsOptimizedImageOptions.builder().cachedInContext(true).build()))\n .vpc(vpc)\n .instanceType(new InstanceType(\"t2.micro\"))\n .build();",
"version": "1"
},
"go": {
"source": "var vpc vpc\n\nautoScalingGroup := autoscaling.NewAutoScalingGroup(this, jsii.String(\"ASG\"), &autoScalingGroupProps{\n\tmachineImage: ecs.ecsOptimizedImage.amazonLinux(&ecsOptimizedImageOptions{\n\t\tcachedInContext: jsii.Boolean(true),\n\t}),\n\tvpc: vpc,\n\tinstanceType: ec2.NewInstanceType(jsii.String(\"t2.micro\")),\n})",
"version": "1"
},
"$": {
"source": "declare const vpc: ec2.Vpc;\nconst autoScalingGroup = new autoscaling.AutoScalingGroup(this, 'ASG', {\n machineImage: ecs.EcsOptimizedImage.amazonLinux({ cachedInContext: true }),\n vpc,\n instanceType: new ec2.InstanceType('t2.micro'),\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-ecs"
},
"field": {
"field": "markdown",
"line": 161
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-autoscaling.AutoScalingGroup",
"@aws-cdk/aws-autoscaling.AutoScalingGroupProps",
"@aws-cdk/aws-ec2.IMachineImage",
"@aws-cdk/aws-ec2.IVpc",
"@aws-cdk/aws-ec2.InstanceType",
"@aws-cdk/aws-ecs.EcsOptimizedImage",
"@aws-cdk/aws-ecs.EcsOptimizedImage#amazonLinux",
"@aws-cdk/aws-ecs.EcsOptimizedImageOptions",
"constructs.Construct"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const vpc: ec2.Vpc;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { SecretValue, Stack } from '@aws-cdk/core';\nimport autoscaling = require('@aws-cdk/aws-autoscaling');\nimport cloudmap = require('@aws-cdk/aws-servicediscovery');\nimport ecs = require('@aws-cdk/aws-ecs');\nimport ec2 = require('@aws-cdk/aws-ec2');\nimport elb = require('@aws-cdk/aws-elasticloadbalancing');\nimport elbv2 = require('@aws-cdk/aws-elasticloadbalancingv2');\nimport events = require('@aws-cdk/aws-events');\nimport kms = require('@aws-cdk/aws-kms');\nimport logs = require('@aws-cdk/aws-logs');\nimport s3 = require('@aws-cdk/aws-s3');\nimport secretsmanager = require('@aws-cdk/aws-secretsmanager');\nimport ssm = require('@aws-cdk/aws-ssm');\nimport targets = require('@aws-cdk/aws-events-targets');\nimport path = require('path');\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\nconst autoScalingGroup = new autoscaling.AutoScalingGroup(this, 'ASG', {\n machineImage: ecs.EcsOptimizedImage.amazonLinux({ cachedInContext: true }),\n vpc,\n instanceType: new ec2.InstanceType('t2.micro'),\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
"syntaxKindCounter": {
"10": 2,
"75": 15,
"104": 1,
"106": 1,
"130": 1,
"153": 1,
"169": 1,
"193": 2,
"194": 4,
"196": 1,
"197": 2,
"225": 2,
"242": 2,
"243": 2,
"281": 3,
"282": 1,
"290": 1
},
"fqnsFingerprint": "a8976a2b7d9775cfe2a33de56be4b9c2b38219655138a62f74b230140beabab9"
},
"121007239be1194e23fd944eec608101cae029f6c9952b50622f624318feebf8": {
"translations": {
"python": {
"source": "# cluster: ecs.Cluster\n\n\ncluster.add_capacity(\"bottlerocket-asg\",\n min_capacity=2,\n instance_type=ec2.InstanceType(\"c5.large\"),\n machine_image=ecs.BottleRocketImage()\n)",
"version": "2"
},
"csharp": {
"source": "Cluster cluster;\n\n\ncluster.AddCapacity(\"bottlerocket-asg\", new AddCapacityOptions {\n MinCapacity = 2,\n InstanceType = new InstanceType(\"c5.large\"),\n MachineImage = new BottleRocketImage()\n});",
"version": "1"
},
"java": {
"source": "Cluster cluster;\n\n\ncluster.addCapacity(\"bottlerocket-asg\", AddCapacityOptions.builder()\n .minCapacity(2)\n .instanceType(new InstanceType(\"c5.large\"))\n .machineImage(new BottleRocketImage())\n .build());",
"version": "1"
},
"go": {
"source": "var cluster cluster\n\n\ncluster.addCapacity(jsii.String(\"bottlerocket-asg\"), &addCapacityOptions{\n\tminCapacity: jsii.Number(2),\n\tinstanceType: ec2.NewInstanceType(jsii.String(\"c5.large\")),\n\tmachineImage: ecs.NewBottleRocketImage(),\n})",
"version": "1"
},
"$": {
"source": "declare const cluster: ecs.Cluster;\n\ncluster.addCapacity('bottlerocket-asg', {\n minCapacity: 2,\n instanceType: new ec2.InstanceType('c5.large'),\n machineImage: new ecs.BottleRocketImage(),\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-ecs"
},
"field": {
"field": "markdown",
"line": 179
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-ec2.IMachineImage",
"@aws-cdk/aws-ec2.InstanceType",
"@aws-cdk/aws-ecs.AddCapacityOptions",
"@aws-cdk/aws-ecs.BottleRocketImage",
"@aws-cdk/aws-ecs.Cluster#addCapacity"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const cluster: ecs.Cluster;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { SecretValue, Stack } from '@aws-cdk/core';\nimport autoscaling = require('@aws-cdk/aws-autoscaling');\nimport cloudmap = require('@aws-cdk/aws-servicediscovery');\nimport ecs = require('@aws-cdk/aws-ecs');\nimport ec2 = require('@aws-cdk/aws-ec2');\nimport elb = require('@aws-cdk/aws-elasticloadbalancing');\nimport elbv2 = require('@aws-cdk/aws-elasticloadbalancingv2');\nimport events = require('@aws-cdk/aws-events');\nimport kms = require('@aws-cdk/aws-kms');\nimport logs = require('@aws-cdk/aws-logs');\nimport s3 = require('@aws-cdk/aws-s3');\nimport secretsmanager = require('@aws-cdk/aws-secretsmanager');\nimport ssm = require('@aws-cdk/aws-ssm');\nimport targets = require('@aws-cdk/aws-events-targets');\nimport path = require('path');\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\ncluster.addCapacity('bottlerocket-asg', {\n minCapacity: 2,\n instanceType: new ec2.InstanceType('c5.large'),\n machineImage: new ecs.BottleRocketImage(),\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
"syntaxKindCounter": {
"8": 1,
"10": 2,
"75": 12,
"130": 1,
"153": 1,
"169": 1,
"193": 1,
"194": 3,
"196": 1,
"197": 2,
"225": 1,
"226": 1,
"242": 1,
"243": 1,
"281": 3,
"290": 1
},
"fqnsFingerprint": "7ddc81982a655cc7f31bf710e88d5c590df9d43746d0697f34e629e300b1848e"
},
"617f46cc0f772b3e05233dc1b103f5072a60d5882f8c0e638a9d381818d98583": {
"translations": {
"python": {
"source": "# cluster: ecs.Cluster\n\n\ncluster.add_capacity(\"graviton-cluster\",\n min_capacity=2,\n instance_type=ec2.InstanceType(\"c6g.large\"),\n machine_image=ecs.EcsOptimizedImage.amazon_linux2(ecs.AmiHardwareType.ARM)\n)",
"version": "2"
},
"csharp": {
"source": "Cluster cluster;\n\n\ncluster.AddCapacity(\"graviton-cluster\", new AddCapacityOptions {\n MinCapacity = 2,\n InstanceType = new InstanceType(\"c6g.large\"),\n MachineImage = EcsOptimizedImage.AmazonLinux2(AmiHardwareType.ARM)\n});",
"version": "1"
},
"java": {
"source": "Cluster cluster;\n\n\ncluster.addCapacity(\"graviton-cluster\", AddCapacityOptions.builder()\n .minCapacity(2)\n .instanceType(new InstanceType(\"c6g.large\"))\n .machineImage(EcsOptimizedImage.amazonLinux2(AmiHardwareType.ARM))\n .build());",
"version": "1"
},
"go": {
"source": "var cluster cluster\n\n\ncluster.addCapacity(jsii.String(\"graviton-cluster\"), &addCapacityOptions{\n\tminCapacity: jsii.Number(2),\n\tinstanceType: ec2.NewInstanceType(jsii.String(\"c6g.large\")),\n\tmachineImage: ecs.ecsOptimizedImage.amazonLinux2(ecs.amiHardwareType_ARM),\n})",
"version": "1"
},
"$": {
"source": "declare const cluster: ecs.Cluster;\n\ncluster.addCapacity('graviton-cluster', {\n minCapacity: 2,\n instanceType: new ec2.InstanceType('c6g.large'),\n machineImage: ecs.EcsOptimizedImage.amazonLinux2(ecs.AmiHardwareType.ARM),\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-ecs"
},
"field": {
"field": "markdown",
"line": 196
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-ec2.IMachineImage",
"@aws-cdk/aws-ec2.InstanceType",
"@aws-cdk/aws-ecs.AddCapacityOptions",
"@aws-cdk/aws-ecs.AmiHardwareType",
"@aws-cdk/aws-ecs.AmiHardwareType#ARM",
"@aws-cdk/aws-ecs.Cluster#addCapacity",
"@aws-cdk/aws-ecs.EcsOptimizedImage",
"@aws-cdk/aws-ecs.EcsOptimizedImage#amazonLinux2"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const cluster: ecs.Cluster;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { SecretValue, Stack } from '@aws-cdk/core';\nimport autoscaling = require('@aws-cdk/aws-autoscaling');\nimport cloudmap = require('@aws-cdk/aws-servicediscovery');\nimport ecs = require('@aws-cdk/aws-ecs');\nimport ec2 = require('@aws-cdk/aws-ec2');\nimport elb = require('@aws-cdk/aws-elasticloadbalancing');\nimport elbv2 = require('@aws-cdk/aws-elasticloadbalancingv2');\nimport events = require('@aws-cdk/aws-events');\nimport kms = require('@aws-cdk/aws-kms');\nimport logs = require('@aws-cdk/aws-logs');\nimport s3 = require('@aws-cdk/aws-s3');\nimport secretsmanager = require('@aws-cdk/aws-secretsmanager');\nimport ssm = require('@aws-cdk/aws-ssm');\nimport targets = require('@aws-cdk/aws-events-targets');\nimport path = require('path');\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\ncluster.addCapacity('graviton-cluster', {\n minCapacity: 2,\n instanceType: new ec2.InstanceType('c6g.large'),\n machineImage: ecs.EcsOptimizedImage.amazonLinux2(ecs.AmiHardwareType.ARM),\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
"syntaxKindCounter": {
"8": 1,
"10": 2,
"75": 16,
"130": 1,
"153": 1,
"169": 1,
"193": 1,
"194": 6,
"196": 2,
"197": 1,
"225": 1,
"226": 1,
"242": 1,
"243": 1,
"281": 3,
"290": 1
},
"fqnsFingerprint": "efc558df2efd70a9b9f2aa7b6cc650da1cb4b55a08aa86968be9baf0bed7fd5e"
},
"5db6bf91e6482b9a5286f7036c9f951d7de11f8b2a8fea10171cf690bdbe98ef": {
"translations": {
"python": {
"source": "# cluster: ecs.Cluster\n\n\ncluster.add_capacity(\"graviton-cluster\",\n min_capacity=2,\n instance_type=ec2.InstanceType(\"c6g.large\"),\n machine_image_type=ecs.MachineImageType.BOTTLEROCKET\n)",
"version": "2"
},
"csharp": {
"source": "Cluster cluster;\n\n\ncluster.AddCapacity(\"graviton-cluster\", new AddCapacityOptions {\n MinCapacity = 2,\n InstanceType = new InstanceType(\"c6g.large\"),\n MachineImageType = MachineImageType.BOTTLEROCKET\n});",
"version": "1"
},
"java": {
"source": "Cluster cluster;\n\n\ncluster.addCapacity(\"graviton-cluster\", AddCapacityOptions.builder()\n .minCapacity(2)\n .instanceType(new InstanceType(\"c6g.large\"))\n .machineImageType(MachineImageType.BOTTLEROCKET)\n .build());",
"version": "1"
},
"go": {
"source": "var cluster cluster\n\n\ncluster.addCapacity(jsii.String(\"graviton-cluster\"), &addCapacityOptions{\n\tminCapacity: jsii.Number(2),\n\tinstanceType: ec2.NewInstanceType(jsii.String(\"c6g.large\")),\n\tmachineImageType: ecs.machineImageType_BOTTLEROCKET,\n})",
"version": "1"
},
"$": {
"source": "declare const cluster: ecs.Cluster;\n\ncluster.addCapacity('graviton-cluster', {\n minCapacity: 2,\n instanceType: new ec2.InstanceType('c6g.large'),\n machineImageType: ecs.MachineImageType.BOTTLEROCKET,\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-ecs"
},
"field": {
"field": "markdown",
"line": 208
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-ec2.InstanceType",
"@aws-cdk/aws-ecs.AddCapacityOptions",
"@aws-cdk/aws-ecs.Cluster#addCapacity",
"@aws-cdk/aws-ecs.MachineImageType",
"@aws-cdk/aws-ecs.MachineImageType#BOTTLEROCKET"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const cluster: ecs.Cluster;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { SecretValue, Stack } from '@aws-cdk/core';\nimport autoscaling = require('@aws-cdk/aws-autoscaling');\nimport cloudmap = require('@aws-cdk/aws-servicediscovery');\nimport ecs = require('@aws-cdk/aws-ecs');\nimport ec2 = require('@aws-cdk/aws-ec2');\nimport elb = require('@aws-cdk/aws-elasticloadbalancing');\nimport elbv2 = require('@aws-cdk/aws-elasticloadbalancingv2');\nimport events = require('@aws-cdk/aws-events');\nimport kms = require('@aws-cdk/aws-kms');\nimport logs = require('@aws-cdk/aws-logs');\nimport s3 = require('@aws-cdk/aws-s3');\nimport secretsmanager = require('@aws-cdk/aws-secretsmanager');\nimport ssm = require('@aws-cdk/aws-ssm');\nimport targets = require('@aws-cdk/aws-events-targets');\nimport path = require('path');\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\ncluster.addCapacity('graviton-cluster', {\n minCapacity: 2,\n instanceType: new ec2.InstanceType('c6g.large'),\n machineImageType: ecs.MachineImageType.BOTTLEROCKET,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
"syntaxKindCounter": {
"8": 1,
"10": 2,
"75": 13,
"130": 1,
"153": 1,
"169": 1,
"193": 1,
"194": 4,
"196": 1,
"197": 1,
"225": 1,
"226": 1,
"242": 1,
"243": 1,
"281": 3,
"290": 1
},
"fqnsFingerprint": "63dd6d3996d48036fc8ca202267807d855e5390efc7c04339d3faf456d671686"
},
"1bb9cfdd26f05f212a90917efd32f414bd3c3e440a45a9723cc5886e54f527b8": {
"translations": {
"python": {
"source": "# cluster: ecs.Cluster\n\n\n# Add an AutoScalingGroup with spot instances to the existing cluster\ncluster.add_capacity(\"AsgSpot\",\n max_capacity=2,\n min_capacity=2,\n desired_capacity=2,\n instance_type=ec2.InstanceType(\"c5.xlarge\"),\n spot_price=\"0.0735\",\n # Enable the Automated Spot Draining support for Amazon ECS\n spot_instance_draining=True\n)",
"version": "2"
},
"csharp": {
"source": "Cluster cluster;\n\n\n// Add an AutoScalingGroup with spot instances to the existing cluster\ncluster.AddCapacity(\"AsgSpot\", new AddCapacityOptions {\n MaxCapacity = 2,\n MinCapacity = 2,\n DesiredCapacity = 2,\n InstanceType = new InstanceType(\"c5.xlarge\"),\n SpotPrice = \"0.0735\",\n // Enable the Automated Spot Draining support for Amazon ECS\n SpotInstanceDraining = true\n});",
"version": "1"
},
"java": {
"source": "Cluster cluster;\n\n\n// Add an AutoScalingGroup with spot instances to the existing cluster\ncluster.addCapacity(\"AsgSpot\", AddCapacityOptions.builder()\n .maxCapacity(2)\n .minCapacity(2)\n .desiredCapacity(2)\n .instanceType(new InstanceType(\"c5.xlarge\"))\n .spotPrice(\"0.0735\")\n // Enable the Automated Spot Draining support for Amazon ECS\n .spotInstanceDraining(true)\n .build());",
"version": "1"
},
"go": {
"source": "var cluster cluster\n\n\n// Add an AutoScalingGroup with spot instances to the existing cluster\ncluster.addCapacity(jsii.String(\"AsgSpot\"), &addCapacityOptions{\n\tmaxCapacity: jsii.Number(2),\n\tminCapacity: jsii.Number(2),\n\tdesiredCapacity: jsii.Number(2),\n\tinstanceType: ec2.NewInstanceType(jsii.String(\"c5.xlarge\")),\n\tspotPrice: jsii.String(\"0.0735\"),\n\t// Enable the Automated Spot Draining support for Amazon ECS\n\tspotInstanceDraining: jsii.Boolean(true),\n})",
"version": "1"
},
"$": {
"source": "declare const cluster: ecs.Cluster;\n\n// Add an AutoScalingGroup with spot instances to the existing cluster\ncluster.addCapacity('AsgSpot', {\n maxCapacity: 2,\n minCapacity: 2,\n desiredCapacity: 2,\n instanceType: new ec2.InstanceType('c5.xlarge'),\n spotPrice: '0.0735',\n // Enable the Automated Spot Draining support for Amazon ECS\n spotInstanceDraining: true,\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-ecs"
},
"field": {
"field": "markdown",
"line": 222
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-ec2.InstanceType",
"@aws-cdk/aws-ecs.AddCapacityOptions",
"@aws-cdk/aws-ecs.Cluster#addCapacity"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\ndeclare const cluster: ecs.Cluster;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { SecretValue, Stack } from '@aws-cdk/core';\nimport autoscaling = require('@aws-cdk/aws-autoscaling');\nimport cloudmap = require('@aws-cdk/aws-servicediscovery');\nimport ecs = require('@aws-cdk/aws-ecs');\nimport ec2 = require('@aws-cdk/aws-ec2');\nimport elb = require('@aws-cdk/aws-elasticloadbalancing');\nimport elbv2 = require('@aws-cdk/aws-elasticloadbalancingv2');\nimport events = require('@aws-cdk/aws-events');\nimport kms = require('@aws-cdk/aws-kms');\nimport logs = require('@aws-cdk/aws-logs');\nimport s3 = require('@aws-cdk/aws-s3');\nimport secretsmanager = require('@aws-cdk/aws-secretsmanager');\nimport ssm = require('@aws-cdk/aws-ssm');\nimport targets = require('@aws-cdk/aws-events-targets');\nimport path = require('path');\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n\n// Add an AutoScalingGroup with spot instances to the existing cluster\ncluster.addCapacity('AsgSpot', {\n maxCapacity: 2,\n minCapacity: 2,\n desiredCapacity: 2,\n instanceType: new ec2.InstanceType('c5.xlarge'),\n spotPrice: '0.0735',\n // Enable the Automated Spot Draining support for Amazon ECS\n spotInstanceDraining: true,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
"syntaxKindCounter": {
"8": 3,
"10": 3,
"75": 13,
"106": 1,
"130": 1,
"153": 1,
"169": 1,
"193": 1,
"194": 2,
"196": 1,
"197": 1,
"225": 1,
"226": 1,
"242": 1,
"243": 1,
"281": 6,
"290": 1
},
"fqnsFingerprint": "d37a1c9b95771269894f1404fcf6d0af7b9d47b3137e12b2ffbb48194f82a971"
},
"9160d872aa0e50f4fd6737806775c28b280ac47895a3eea288872a9714be1bae": {
"translations": {
"python": {
"source": "# Given\n# cluster: ecs.Cluster\n# key: kms.Key\n\n# Then, use that key to encrypt the lifecycle-event SNS Topic.\ncluster.add_capacity(\"ASGEncryptedSNS\",\n instance_type=ec2.InstanceType(\"t2.xlarge\"),\n desired_capacity=3,\n topic_encryption_key=key\n)",
"version": "2"
},
"csharp": {
"source": "// Given\nCluster cluster;\nKey key;\n\n// Then, use that key to encrypt the lifecycle-event SNS Topic.\ncluster.AddCapacity(\"ASGEncryptedSNS\", new AddCapacityOptions {\n InstanceType = new InstanceType(\"t2.xlarge\"),\n DesiredCapacity = 3,\n TopicEncryptionKey = key\n});",
"version": "1"
},
"java": {
"source": "// Given\nCluster cluster;\nKey key;\n\n// Then, use that key to encrypt the lifecycle-event SNS Topic.\ncluster.addCapacity(\"ASGEncryptedSNS\", AddCapacityOptions.builder()\n .instanceType(new InstanceType(\"t2.xlarge\"))\n .desiredCapacity(3)\n .topicEncryptionKey(key)\n .build());",
"version": "1"
},
"go": {
"source": "// Given\nvar cluster cluster\nvar key key\n\n// Then, use that key to encrypt the lifecycle-event SNS Topic.\ncluster.addCapacity(jsii.String(\"ASGEncryptedSNS\"), &addCapacityOptions{\n\tinstanceType: ec2.NewInstanceType(jsii.String(\"t2.xlarge\")),\n\tdesiredCapacity: jsii.Number(3),\n\ttopicEncryptionKey: key,\n})",
"version": "1"
},
"$": {
"source": "// Given\ndeclare const cluster: ecs.Cluster;\ndeclare const key: kms.Key;\n// Then, use that key to encrypt the lifecycle-event SNS Topic.\ncluster.addCapacity('ASGEncryptedSNS', {\n instanceType: new ec2.InstanceType(\"t2.xlarge\"),\n desiredCapacity: 3,\n topicEncryptionKey: key,\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-ecs"
},
"field": {
"field": "markdown",
"line": 244
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-ec2.InstanceType",
"@aws-cdk/aws-ecs.AddCapacityOptions",
"@aws-cdk/aws-ecs.Cluster#addCapacity",
"@aws-cdk/aws-kms.IKey"
],
"fullSource": "// Hoisted imports begin after !show marker below\n/// !show\n// Given\ndeclare const cluster: ecs.Cluster;\ndeclare const key: kms.Key;\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture with packages imported, but nothing else\nimport { Construct } from 'constructs';\nimport { SecretValue, Stack } from '@aws-cdk/core';\nimport autoscaling = require('@aws-cdk/aws-autoscaling');\nimport cloudmap = require('@aws-cdk/aws-servicediscovery');\nimport ecs = require('@aws-cdk/aws-ecs');\nimport ec2 = require('@aws-cdk/aws-ec2');\nimport elb = require('@aws-cdk/aws-elasticloadbalancing');\nimport elbv2 = require('@aws-cdk/aws-elasticloadbalancingv2');\nimport events = require('@aws-cdk/aws-events');\nimport kms = require('@aws-cdk/aws-kms');\nimport logs = require('@aws-cdk/aws-logs');\nimport s3 = require('@aws-cdk/aws-s3');\nimport secretsmanager = require('@aws-cdk/aws-secretsmanager');\nimport ssm = require('@aws-cdk/aws-ssm');\nimport targets = require('@aws-cdk/aws-events-targets');\nimport path = require('path');\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\n// Then, use that key to encrypt the lifecycle-event SNS Topic.\ncluster.addCapacity('ASGEncryptedSNS', {\n instanceType: new ec2.InstanceType(\"t2.xlarge\"),\n desiredCapacity: 3,\n topicEncryptionKey: key,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
"syntaxKindCounter": {
"8": 1,
"10": 2,
"75": 14,
"130": 2,
"153": 2,
"169": 2,
"193": 1,
"194": 2,
"196": 1,
"197": 1,
"225": 2,
"226": 1,
"242": 2,
"243": 2,
"281": 3,
"290": 1
},
"fqnsFingerprint": "6e589c607129ff89117ed419b23c716b680fcf4513bb5dded1e7d3d5206f56e1"
},
"698e45bf0b8b2a82b165279ebc980100a0ff997bf6120bc5625912c513742012": {
"translations": {
"python": {
"source": "fargate_task_definition = ecs.FargateTaskDefinition(self, \"TaskDef\",\n memory_limit_mi_b=512,\n cpu=256\n)",
"version": "2"
},
"csharp": {
"source": "FargateTaskDefinition fargateTaskDefinition = new FargateTaskDefinition(this, \"TaskDef\", new FargateTaskDefinitionProps {\n MemoryLimitMiB = 512,\n Cpu = 256\n});",
"version": "1"
},
"java": {
"source": "FargateTaskDefinition fargateTaskDefinition = FargateTaskDefinition.Builder.create(this, \"TaskDef\")\n .memoryLimitMiB(512)\n .cpu(256)\n .build();",
"version": "1"
},
"go": {
"source": "fargateTaskDefinition := ecs.NewFargateTaskDefinition(this, jsii.String(\"TaskDef\"), &fargateTaskDefinitionProps{\n\tmemoryLimitMiB: jsii.Number(512),\n\tcpu: jsii.Number(256),\n})",
"version