@aws-cdk/aws-ecs
Version:
The CDK Construct Library for AWS::ECS
681 lines • 1.64 MB
JSON
{
"version": "2",
"toolVersion": "1.58.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": "19c4943ca210b27dd8ed9d4487b89544e896d690765e2c83622b5156782e313f"
},
"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": "861e9d87fd12ab962786e151183b18d423c5e8695ede71cc3a110ec4e9f638a3"
},
"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": "8f29c087c5eb2aa46e8ba2431de02420e041dab4f5f0367910ab967bb162f53f"
},
"b038e886ecca7a7b690d0dc4cd2c1eb34700cdd6c0800a822ff78748889b09af": {
"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\ncluster.add_auto_scaling_group(auto_scaling_group)",
"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\ncluster.AddAutoScalingGroup(autoScalingGroup);",
"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\ncluster.addAutoScalingGroup(autoScalingGroup);",
"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\ncluster.addAutoScalingGroup(autoScalingGroup)",
"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\ncluster.addAutoScalingGroup(autoScalingGroup);",
"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-ec2.IMachineImage",
"@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#addAutoScalingGroup",
"@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\ncluster.addAutoScalingGroup(autoScalingGroup);\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n",
"syntaxKindCounter": {
"8": 2,
"10": 5,
"75": 28,
"104": 2,
"130": 1,
"153": 1,
"169": 1,
"193": 3,
"194": 8,
"196": 3,
"197": 4,
"225": 3,
"226": 2,
"242": 3,
"243": 3,
"281": 5,
"282": 2,
"290": 1
},
"fqnsFingerprint": "b430b7db3f004410db21b13a1a3b79bdf828d77301f76b9d4dd6b04c17245885"
},
"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": 158
}
},
"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": "0ab6d4bf5239087708ec0fe1f3d834d6a0573370ce11776bfae0bd0277aabbda"
},
"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": 176
}
},
"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": "fd3cf1453b819f54e5967a90e83bbe3e559ce7bc5c11c08d32b79594ba322767"
},
"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": 193
}
},
"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": "4467a15ad2dbe31ebecc9a403683a9916440d83a0419a4875005f4a06929f0e5"
},
"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": 205
}
},
"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": "550f026e76586478f89ca881cd550ecbb984d55cccc1fef23200850d471b77b3"
},
"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": 219
}
},
"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": "9de06e209a8e27c540f27300c71d63367fc3d78fa35408819dcb896cafebb71f"
},
"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": 241
}
},
"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": "edc95e5ca0ea575815ef250bdd63991bdd8ef2dda558b83ac85a628bc3762f8d"
},
"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": "1"
},
"$": {
"source": "const fargateTaskDefinition = new ecs.FargateTaskDefinition(this, 'TaskDef', {\n memoryLimitMiB: 512,\n cpu: 256,\n});",
"version": "0"
}
},
"location": {
"api": {
"api": "moduleReadme",
"moduleFqn": "@aws-cdk/aws-ecs"
},
"field": {
"field": "markdown",
"line": 268
}
},
"didCompile": true,
"fqnsReferenced": [
"@aws-cdk/aws-ecs.FargateTaskDefinition",
"@aws-cdk/aws-ecs.FargateTaskDefinitionProps",
"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 = requ