class InstanceTagSet
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.CodeDeploy.InstanceTagSet |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awscodedeploy#InstanceTagSet |
Java | software.amazon.awscdk.services.codedeploy.InstanceTagSet |
Python | aws_cdk.aws_codedeploy.InstanceTagSet |
TypeScript (source) | aws-cdk-lib » aws_codedeploy » InstanceTagSet |
Represents a set of instance tag groups.
An instance will match a set if it matches all of the groups in the set - in other words, sets follow 'and' semantics. You can have a maximum of 3 tag groups inside a set.
Example
import * as autoscaling from 'aws-cdk-lib/aws-autoscaling';
import * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';
declare const application: codedeploy.ServerApplication;
declare const asg: autoscaling.AutoScalingGroup;
declare const alarm: cloudwatch.Alarm;
const deploymentGroup = new codedeploy.ServerDeploymentGroup(this, 'CodeDeployDeploymentGroup', {
application,
deploymentGroupName: 'MyDeploymentGroup',
autoScalingGroups: [asg],
// adds User Data that installs the CodeDeploy agent on your auto-scaling groups hosts
// default: true
installAgent: true,
// adds EC2 instances matching tags
ec2InstanceTags: new codedeploy.InstanceTagSet(
{
// any instance with tags satisfying
// key1=v1 or key1=v2 or key2 (any value) or value v3 (any key)
// will match this group
'key1': ['v1', 'v2'],
'key2': [],
'': ['v3'],
},
),
// adds on-premise instances matching tags
onPremiseInstanceTags: new codedeploy.InstanceTagSet(
// only instances with tags (key1=v1 or key1=v2) AND key2=v3 will match this set
{
'key1': ['v1', 'v2'],
},
{
'key2': ['v3'],
},
),
// CloudWatch alarms
alarms: [alarm],
// whether to ignore failure to fetch the status of alarms from CloudWatch
// default: false
ignorePollAlarmsFailure: false,
// whether to skip the step of checking CloudWatch alarms during the deployment process
// default: false
ignoreAlarmConfiguration: false,
// auto-rollback configuration
autoRollback: {
failedDeployment: true, // default: true
stoppedDeployment: true, // default: false
deploymentInAlarm: true, // default: true if you provided any alarms, false otherwise
},
// whether the deployment group was configured to have CodeDeploy install a termination hook into an Auto Scaling group
// default: false
terminationHook: true,
});
Initializer
new InstanceTagSet(...instanceTagGroups: { [string]: string[] }[])
Parameters
- instanceTagGroups
{ [string]: string[] }
Properties
Name | Type | Description |
---|---|---|
instance | { [string]: string[] }[] |
instanceTagGroups
Type:
{ [string]: string[] }[]