Skip to content

Commit

Permalink
feat(core): facility to warn when deprecated APIs are used (#9585)
Browse files Browse the repository at this point in the history
Introduce `Annotations.addDeprecation()` which will attach a warning to the construct indicating that a deprecated API is used.

At the moment, we only use this to warn when `.node` is used instead of `.construct`, but we will gradually use this to report the usage of all deprecated APIs as a preparation for v2.0.

If the environment variable `CDK_BLOCK_DEPRECATIONS` is set (and it is set in `cdk-test`), it will cause usage of deprecated APIs to throw an error instead.

Related: aws/aws-cdk-rfcs#192

----

#### Build will be failing until #9584 is merged

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
Elad Ben-Israel committed Aug 20, 2020
1 parent 392675f commit b1d0ac0
Show file tree
Hide file tree
Showing 31 changed files with 218 additions and 68 deletions.
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-athena/test/athena.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ describe('Athena Workgroup Tags', () => {
});
test('test tag aspect spec correction', () => {
const stack = new cdk.Stack();
cdk.Tag.add(stack, 'key1', 'value1');
cdk.Tag.add(stack, 'key2', 'value2');
cdk.Tags.of(stack).add('key1', 'value1');
cdk.Tags.of(stack).add('key2', 'value2');
new CfnWorkGroup(stack, 'Athena-Workgroup', {
name: 'HelloWorld',
description: 'A WorkGroup',
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as sns from '@aws-cdk/aws-sns';

import {
CfnAutoScalingRollingUpdate, Construct, Duration, Fn, IResource, Lazy, PhysicalName, Resource, Stack,
Tag, Tokenization, withResolved,
Tokenization, withResolved, Tags,
} from '@aws-cdk/core';
import { CfnAutoScalingGroup, CfnAutoScalingGroupProps, CfnLaunchConfiguration } from './autoscaling.generated';
import { BasicLifecycleHookProps, LifecycleHook } from './lifecycle-hook';
Expand Down Expand Up @@ -595,7 +595,7 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements
});
this.connections = new ec2.Connections({ securityGroups: [this.securityGroup] });
this.securityGroups.push(this.securityGroup);
this.node.applyAspect(new Tag(NAME_TAG, this.node.path));
Tags.of(this).add(NAME_TAG, this.node.path);

this.role = props.role || new iam.Role(this, 'InstanceRole', {
roleName: PhysicalName.GENERATE_IF_NEEDED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,9 @@ nodeunitShim({
pauseTime: cdk.Duration.seconds(345),
},
});
asg.node.applyAspect(new cdk.Tag('superfood', 'acai'));
asg.node.applyAspect(new cdk.Tag('notsuper', 'caramel', { applyToLaunchedInstances: false }));

cdk.Tags.of(asg).add('superfood', 'acai');
cdk.Tags.of(asg).add('notsuper', 'caramel', { applyToLaunchedInstances: false });

// THEN
expect(stack).to(haveResource('AWS::AutoScaling::AutoScalingGroup', {
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-backup/lib/selection.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as iam from '@aws-cdk/aws-iam';
import { Construct, Lazy, Resource } from '@aws-cdk/core';
import { Construct, Lazy, Resource, Aspects } from '@aws-cdk/core';
import { CfnBackupSelection } from './backup.generated';
import { BackupableResourcesCollector } from './backupable-resources-collector';
import { IBackupPlan } from './plan';
Expand Down Expand Up @@ -126,7 +126,7 @@ export class BackupSelection extends Resource implements iam.IGrantable {
}

if (resource.construct) {
resource.construct.node.applyAspect(this.backupableResourcesCollector);
Aspects.of(resource.construct).add(this.backupableResourcesCollector);
// Cannot push `this.backupableResourcesCollector.resources` to
// `this.resources` here because it has not been evaluated yet.
// Will be concatenated to `this.resources` in a `Lazy.listValue`
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-cognito/test/user-pool.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import '@aws-cdk/assert/jest';
import { ABSENT } from '@aws-cdk/assert/lib/assertions/have-resource';
import { Role, ServicePrincipal } from '@aws-cdk/aws-iam';
import * as lambda from '@aws-cdk/aws-lambda';
import { CfnParameter, Construct, Duration, Stack, Tag } from '@aws-cdk/core';
import { CfnParameter, Construct, Duration, Stack, Tags } from '@aws-cdk/core';
import { AccountRecovery, Mfa, NumberAttribute, StringAttribute, UserPool, UserPoolIdentityProvider, UserPoolOperation, VerificationEmailStyle } from '../lib';

describe('User Pool', () => {
Expand Down Expand Up @@ -227,7 +227,7 @@ describe('User Pool', () => {
const pool = new UserPool(stack, 'Pool', {
userPoolName: 'myPool',
});
Tag.add(pool, 'PoolTag', 'PoolParty');
Tags.of(pool).add('PoolTag', 'PoolParty');

// THEN
expect(stack).toHaveResourceLike('AWS::Cognito::UserPool', {
Expand Down
10 changes: 5 additions & 5 deletions packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import '@aws-cdk/assert/jest';
import * as appscaling from '@aws-cdk/aws-applicationautoscaling';
import * as iam from '@aws-cdk/aws-iam';
import * as kms from '@aws-cdk/aws-kms';
import { App, CfnDeletionPolicy, ConstructNode, Duration, PhysicalName, RemovalPolicy, Stack, Tag } from '@aws-cdk/core';
import { App, CfnDeletionPolicy, ConstructNode, Duration, PhysicalName, RemovalPolicy, Stack, Tags } from '@aws-cdk/core';
import {
Attribute,
AttributeType,
Expand Down Expand Up @@ -324,7 +324,7 @@ test('when specifying every property', () => {
partitionKey: TABLE_PARTITION_KEY,
sortKey: TABLE_SORT_KEY,
});
table.node.applyAspect(new Tag('Environment', 'Production'));
Tags.of(table).add('Environment', 'Production');

expect(stack).toHaveResource('AWS::DynamoDB::Table',
{
Expand Down Expand Up @@ -357,7 +357,7 @@ test('when specifying sse with customer managed CMK', () => {
encryption: TableEncryption.CUSTOMER_MANAGED,
partitionKey: TABLE_PARTITION_KEY,
});
table.node.applyAspect(new Tag('Environment', 'Production'));
Tags.of(table).add('Environment', 'Production');

expect(stack).toHaveResource('AWS::DynamoDB::Table', {
'SSESpecification': {
Expand All @@ -383,7 +383,7 @@ test('when specifying only encryptionKey', () => {
encryptionKey,
partitionKey: TABLE_PARTITION_KEY,
});
table.node.applyAspect(new Tag('Environment', 'Production'));
Tags.of(table).add('Environment', 'Production');

expect(stack).toHaveResource('AWS::DynamoDB::Table', {
'SSESpecification': {
Expand All @@ -410,7 +410,7 @@ test('when specifying sse with customer managed CMK with encryptionKey provided
encryptionKey,
partitionKey: TABLE_PARTITION_KEY,
});
table.node.applyAspect(new Tag('Environment', 'Production'));
Tags.of(table).add('Environment', 'Production');

expect(stack).toHaveResource('AWS::DynamoDB::Table', {
'SSESpecification': {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { App, RemovalPolicy, Stack, Tag } from '@aws-cdk/core';
import { App, RemovalPolicy, Stack, Tags } from '@aws-cdk/core';
import { Attribute, AttributeType, BillingMode, ProjectionType, StreamViewType, Table } from '../lib';

// CDK parameters
Expand Down Expand Up @@ -58,7 +58,7 @@ const tableWithGlobalAndLocalSecondaryIndex = new Table(stack, TABLE_WITH_GLOBAL
removalPolicy: RemovalPolicy.DESTROY,
});

tableWithGlobalAndLocalSecondaryIndex.node.applyAspect(new Tag('Environment', 'Production'));
Tags.of(tableWithGlobalAndLocalSecondaryIndex).add('Environment', 'Production');

tableWithGlobalAndLocalSecondaryIndex.addGlobalSecondaryIndex({
indexName: GSI_TEST_CASE_1,
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.sse.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as iam from '@aws-cdk/aws-iam';
import * as kms from '@aws-cdk/aws-kms';
import { App, RemovalPolicy, Stack, Tag } from '@aws-cdk/core';
import { App, RemovalPolicy, Stack, Tags } from '@aws-cdk/core';
import { Attribute, AttributeType, ProjectionType, StreamViewType, Table, TableEncryption } from '../lib';

// CDK parameters
Expand Down Expand Up @@ -58,7 +58,7 @@ const tableWithGlobalAndLocalSecondaryIndex = new Table(stack, TABLE_WITH_GLOBAL
removalPolicy: RemovalPolicy.DESTROY,
});

tableWithGlobalAndLocalSecondaryIndex.node.applyAspect(new Tag('Environment', 'Production'));
Tags.of(tableWithGlobalAndLocalSecondaryIndex).add('Environment', 'Production');
tableWithGlobalAndLocalSecondaryIndex.addGlobalSecondaryIndex({
indexName: GSI_TEST_CASE_1,
partitionKey: GSI_PARTITION_KEY,
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as iam from '@aws-cdk/aws-iam';
import { App, RemovalPolicy, Stack, Tag } from '@aws-cdk/core';
import { App, RemovalPolicy, Stack, Tags } from '@aws-cdk/core';
import { Attribute, AttributeType, ProjectionType, StreamViewType, Table } from '../lib';

// CDK parameters
Expand Down Expand Up @@ -56,7 +56,7 @@ const tableWithGlobalAndLocalSecondaryIndex = new Table(stack, TABLE_WITH_GLOBAL
removalPolicy: RemovalPolicy.DESTROY,
});

tableWithGlobalAndLocalSecondaryIndex.node.applyAspect(new Tag('Environment', 'Production'));
Tags.of(tableWithGlobalAndLocalSecondaryIndex).add('Environment', 'Production');
tableWithGlobalAndLocalSecondaryIndex.addGlobalSecondaryIndex({
indexName: GSI_TEST_CASE_1,
partitionKey: GSI_PARTITION_KEY,
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-ec2/lib/instance.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as crypto from 'crypto';
import * as iam from '@aws-cdk/aws-iam';

import { Construct, Duration, Fn, IResource, Lazy, Resource, Stack, Tag } from '@aws-cdk/core';
import { Construct, Duration, Fn, IResource, Lazy, Resource, Stack, Tags } from '@aws-cdk/core';
import { CloudFormationInit } from './cfn-init';
import { Connections, IConnectable } from './connections';
import { CfnInstance } from './ec2.generated';
Expand Down Expand Up @@ -309,7 +309,7 @@ export class Instance extends Resource implements IInstance {
}
this.connections = new Connections({ securityGroups: [this.securityGroup] });
this.securityGroups.push(this.securityGroup);
Tag.add(this, NAME_TAG, props.instanceName || this.node.path);
Tags.of(this).add(NAME_TAG, props.instanceName || this.node.path);

this.role = props.role || new iam.Role(this, 'InstanceRole', {
assumedBy: new iam.ServicePrincipal('ec2.amazonaws.com'),
Expand Down
10 changes: 5 additions & 5 deletions packages/@aws-cdk/aws-ec2/lib/volume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as crypto from 'crypto';

import { AccountRootPrincipal, Grant, IGrantable } from '@aws-cdk/aws-iam';
import { IKey, ViaServicePrincipal } from '@aws-cdk/aws-kms';
import { Construct, IResource, Resource, Size, SizeRoundingBehavior, Stack, Tag, Token } from '@aws-cdk/core';
import { Construct, IResource, Resource, Size, SizeRoundingBehavior, Stack, Token, Tags } from '@aws-cdk/core';
import { CfnInstance, CfnVolume } from './ec2.generated';
import { IInstance } from './instance';

Expand Down Expand Up @@ -507,8 +507,8 @@ abstract class VolumeBase extends Resource implements IVolume {

// The ResourceTag condition requires that all resources involved in the operation have
// the given tag, so we tag this and all constructs given.
Tag.add(this, tagKey, tagValue);
constructs.forEach(construct => Tag.add(construct, tagKey, tagValue));
Tags.of(this).add(tagKey, tagValue);
constructs.forEach(construct => Tags.of(construct).add(tagKey, tagValue));

return result;
}
Expand Down Expand Up @@ -536,8 +536,8 @@ abstract class VolumeBase extends Resource implements IVolume {

// The ResourceTag condition requires that all resources involved in the operation have
// the given tag, so we tag this and all constructs given.
Tag.add(this, tagKey, tagValue);
constructs.forEach(construct => Tag.add(construct, tagKey, tagValue));
Tags.of(this).add(tagKey, tagValue);
constructs.forEach(construct => Tags.of(construct).add(tagKey, tagValue));

return result;
}
Expand Down
10 changes: 5 additions & 5 deletions packages/@aws-cdk/aws-ec2/lib/vpc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as cxschema from '@aws-cdk/cloud-assembly-schema';
import {
ConcreteDependable, Construct, ContextProvider, DependableTrait, IConstruct,
IDependable, IResource, Lazy, Resource, Stack, Tag, Token,
IDependable, IResource, Lazy, Resource, Stack, Token, Tags,
} from '@aws-cdk/core';
import * as cxapi from '@aws-cdk/cx-api';
import {
Expand Down Expand Up @@ -1182,7 +1182,7 @@ export class Vpc extends VpcBase {
this.vpcDefaultSecurityGroup = this.resource.attrDefaultSecurityGroup;
this.vpcIpv6CidrBlocks = this.resource.attrIpv6CidrBlocks;

this.node.applyAspect(new Tag(NAME_TAG, this.node.path));
Tags.of(this).add(NAME_TAG, this.node.path);

this.availabilityZones = stack.availabilityZones;

Expand Down Expand Up @@ -1369,8 +1369,8 @@ export class Vpc extends VpcBase {

// These values will be used to recover the config upon provider import
const includeResourceTypes = [CfnSubnet.CFN_RESOURCE_TYPE_NAME];
subnet.node.applyAspect(new Tag(SUBNETNAME_TAG, subnetConfig.name, { includeResourceTypes }));
subnet.node.applyAspect(new Tag(SUBNETTYPE_TAG, subnetTypeTagValue(subnetConfig.subnetType), { includeResourceTypes }));
Tags.of(subnet).add(SUBNETNAME_TAG, subnetConfig.name, { includeResourceTypes });
Tags.of(subnet).add(SUBNETTYPE_TAG, subnetTypeTagValue(subnetConfig.subnetType), { includeResourceTypes });
});
}
}
Expand Down Expand Up @@ -1488,7 +1488,7 @@ export class Subnet extends Resource implements ISubnet {

Object.defineProperty(this, VPC_SUBNET_SYMBOL, { value: true });

this.node.applyAspect(new Tag(NAME_TAG, this.node.path));
Tags.of(this).add(NAME_TAG, this.node.path);

this.availabilityZone = props.availabilityZone;
const subnet = new CfnSubnet(this, 'Subnet', {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ec2/test/volume.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ nodeunitShim({
});

// WHEN
cdk.Tag.add(volume, 'TagKey', 'TagValue');
cdk.Tags.of(volume).add('TagKey', 'TagValue');

// THEN
cdkExpect(stack).to(haveResource('AWS::EC2::Volume', {
Expand Down
8 changes: 4 additions & 4 deletions packages/@aws-cdk/aws-ec2/test/vpc.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { countResources, expect, haveResource, haveResourceLike, isSuperObject, MatchStyle } from '@aws-cdk/assert';
import { CfnOutput, Lazy, Stack, Tag } from '@aws-cdk/core';
import { CfnOutput, Lazy, Stack, Tags } from '@aws-cdk/core';
import { nodeunitShim, Test } from 'nodeunit-shim';
import {
AclCidr, AclTraffic, CfnSubnet, CfnVPC, DefaultInstanceTenancy, GenericLinuxImage, InstanceType, InterfaceVpcEndpoint,
Expand Down Expand Up @@ -1035,8 +1035,8 @@ nodeunitShim({

const vpc = new Vpc(stack, 'TheVPC');
// overwrite to set propagate
vpc.node.applyAspect(new Tag('BusinessUnit', 'Marketing', { includeResourceTypes: [CfnVPC.CFN_RESOURCE_TYPE_NAME] }));
vpc.node.applyAspect(new Tag('VpcType', 'Good'));
Tags.of(vpc).add('BusinessUnit', 'Marketing', { includeResourceTypes: [CfnVPC.CFN_RESOURCE_TYPE_NAME] });
Tags.of(vpc).add('VpcType', 'Good');
expect(stack).to(haveResource('AWS::EC2::VPC', hasTags(toCfnTags(allTags))));
const taggables = ['Subnet', 'InternetGateway', 'NatGateway', 'RouteTable'];
const propTags = toCfnTags(tags);
Expand Down Expand Up @@ -1067,7 +1067,7 @@ nodeunitShim({
const vpc = new Vpc(stack, 'TheVPC');
const tag = { Key: 'Late', Value: 'Adder' };
expect(stack).notTo(haveResource('AWS::EC2::VPC', hasTags([tag])));
vpc.node.applyAspect(new Tag(tag.Key, tag.Value));
Tags.of(vpc).add(tag.Key, tag.Value);
expect(stack).to(haveResource('AWS::EC2::VPC', hasTags([tag])));
test.done();
},
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-efs/lib/efs-file-system.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as ec2 from '@aws-cdk/aws-ec2';
import * as kms from '@aws-cdk/aws-kms';
import { ConcreteDependable, Construct, IDependable, IResource, RemovalPolicy, Resource, Size, Tag } from '@aws-cdk/core';
import { ConcreteDependable, Construct, IDependable, IResource, RemovalPolicy, Resource, Size, Tags } from '@aws-cdk/core';
import { AccessPoint, AccessPointOptions } from './access-point';
import { CfnFileSystem, CfnMountTarget } from './efs.generated';

Expand Down Expand Up @@ -255,7 +255,7 @@ export class FileSystem extends Resource implements IFileSystem {
filesystem.applyRemovalPolicy(props.removalPolicy);

this.fileSystemId = filesystem.ref;
Tag.add(this, 'Name', props.fileSystemName || this.node.path);
Tags.of(this).add('Name', props.fileSystemName || this.node.path);

const securityGroup = (props.securityGroup || new ec2.SecurityGroup(this, 'EfsSecurityGroup', {
vpc: props.vpc,
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-efs/test/efs-file-system.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect as expectCDK, haveResource, ResourcePart } from '@aws-cdk/assert';
import * as ec2 from '@aws-cdk/aws-ec2';
import * as kms from '@aws-cdk/aws-kms';
import { RemovalPolicy, Size, Stack, Tag } from '@aws-cdk/core';
import { RemovalPolicy, Size, Stack, Tags } from '@aws-cdk/core';
import { FileSystem, LifecyclePolicy, PerformanceMode, ThroughputMode } from '../lib';

let stack = new Stack();
Expand Down Expand Up @@ -176,7 +176,7 @@ test('support tags', () => {
const fileSystem = new FileSystem(stack, 'EfsFileSystem', {
vpc,
});
Tag.add(fileSystem, 'Name', 'LookAtMeAndMyFancyTags');
Tags.of(fileSystem).add('Name', 'LookAtMeAndMyFancyTags');

// THEN
expectCDK(stack).to(haveResource('AWS::EFS::FileSystem', {
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-eks-legacy/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as ec2 from '@aws-cdk/aws-ec2';
import * as iam from '@aws-cdk/aws-iam';
import * as lambda from '@aws-cdk/aws-lambda';
import * as ssm from '@aws-cdk/aws-ssm';
import { CfnOutput, Construct, Duration, IResource, Resource, Stack, Tag, Token } from '@aws-cdk/core';
import { CfnOutput, Construct, Duration, IResource, Resource, Stack, Token, Tags } from '@aws-cdk/core';
import { AwsAuth } from './aws-auth';
import { ClusterResource } from './cluster-resource';
import { CfnCluster, CfnClusterProps } from './eks.generated';
Expand Down Expand Up @@ -523,7 +523,7 @@ export class Cluster extends Resource implements ICluster {
autoScalingGroup.role.addManagedPolicy(iam.ManagedPolicy.fromAwsManagedPolicyName('AmazonEC2ContainerRegistryReadOnly'));

// EKS Required Tags
Tag.add(autoScalingGroup, `kubernetes.io/cluster/${this.clusterName}`, 'owned', {
Tags.of(autoScalingGroup).add(`kubernetes.io/cluster/${this.clusterName}`, 'owned', {
applyToLaunchedInstances: true,
});

Expand Down Expand Up @@ -640,7 +640,7 @@ export class Cluster extends Resource implements ICluster {
continue;
}

subnet.node.applyAspect(new Tag(tag, '1'));
Tags.of(subnet).add(tag, '1');
}
};

Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-eks/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as autoscaling from '@aws-cdk/aws-autoscaling';
import * as ec2 from '@aws-cdk/aws-ec2';
import * as iam from '@aws-cdk/aws-iam';
import * as ssm from '@aws-cdk/aws-ssm';
import { CfnOutput, CfnResource, Construct, IResource, Resource, Stack, Tag, Token, Duration } from '@aws-cdk/core';
import { CfnOutput, CfnResource, Construct, IResource, Resource, Stack, Tags, Token, Duration } from '@aws-cdk/core';
import * as YAML from 'yaml';
import { AwsAuth } from './aws-auth';
import { clusterArnComponents, ClusterResource } from './cluster-resource';
Expand Down Expand Up @@ -872,7 +872,7 @@ export class Cluster extends Resource implements ICluster {
autoScalingGroup.role.addManagedPolicy(iam.ManagedPolicy.fromAwsManagedPolicyName('AmazonEC2ContainerRegistryReadOnly'));

// EKS Required Tags
Tag.add(autoScalingGroup, `kubernetes.io/cluster/${this.clusterName}`, 'owned', {
Tags.of(autoScalingGroup).add(`kubernetes.io/cluster/${this.clusterName}`, 'owned', {
applyToLaunchedInstances: true,
});

Expand Down Expand Up @@ -1180,7 +1180,7 @@ export class Cluster extends Resource implements ICluster {
continue;
}

subnet.node.applyAspect(new Tag(tag, '1'));
Tags.of(subnet).add(tag, '1');
}
};

Expand Down
Loading

0 comments on commit b1d0ac0

Please sign in to comment.