Skip to content

Commit

Permalink
chore: add metadata updater tool to add imports and addMetadata state…
Browse files Browse the repository at this point in the history
…ment
  • Loading branch information
GavinZZ committed Jan 15, 2025
1 parent 8f99fdf commit 7f7d372
Show file tree
Hide file tree
Showing 355 changed files with 6,623 additions and 674 deletions.
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-amplify-alpha/lib/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { BasicAuth } from './basic-auth';
import { Branch, BranchOptions } from './branch';
import { Domain, DomainOptions } from './domain';
import { renderEnvironmentVariables } from './utils';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* An Amplify Console application
Expand Down Expand Up @@ -224,6 +225,8 @@ export class App extends Resource implements IApp, iam.IGrantable {

constructor(scope: Construct, id: string, props: AppProps) {
super(scope, id);
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

this.customRules = props.customRules || [];
this.environmentVariables = props.environmentVariables || {};
Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-amplify-alpha/lib/branch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { IApp } from './app';
import { BasicAuth } from './basic-auth';
import { renderEnvironmentVariables } from './utils';
import { AssetDeploymentIsCompleteFunction, AssetDeploymentOnEventFunction } from '../custom-resource-handlers/dist/aws-amplify-alpha/asset-deployment-provider.generated';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* A branch
Expand Down Expand Up @@ -162,6 +163,8 @@ export class Branch extends Resource implements IBranch {

constructor(scope: Construct, id: string, props: BranchProps) {
super(scope, id);
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

this.environmentVariables = props.environmentVariables || {};

Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-amplify-alpha/lib/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Construct } from 'constructs';
import { CfnDomain } from 'aws-cdk-lib/aws-amplify';
import { IApp } from './app';
import { IBranch } from './branch';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* Options to add a domain to an application
Expand Down Expand Up @@ -127,6 +128,8 @@ export class Domain extends Resource {

constructor(scope: Construct, id: string, props: DomainProps) {
super(scope, id);
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

this.subDomains = props.subDomains || [];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as cdk from 'aws-cdk-lib/core';
import { Construct } from 'constructs';
import { CfnAutoScalingConfiguration } from 'aws-cdk-lib/aws-apprunner';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* Properties of the App Runner Auto Scaling Configuration.
Expand Down Expand Up @@ -154,6 +155,8 @@ export class AutoScalingConfiguration extends cdk.Resource implements IAutoScali
super(scope, id, {
physicalName: props.autoScalingConfigurationName,
});
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

this.validateAutoScalingConfiguration(props);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as cdk from 'aws-cdk-lib/core';
import { Construct } from 'constructs';
import { CfnObservabilityConfiguration } from 'aws-cdk-lib/aws-apprunner';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* The implementation provider chosen for tracing App Runner services
Expand Down Expand Up @@ -140,6 +141,8 @@ export class ObservabilityConfiguration extends cdk.Resource implements IObserva
super(scope, id, {
physicalName: props.observabilityConfigurationName,
});
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

if (props.observabilityConfigurationName !== undefined && !cdk.Token.isUnresolved(props.observabilityConfigurationName)) {

Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-apprunner-alpha/lib/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { CfnService } from 'aws-cdk-lib/aws-apprunner';
import { IVpcConnector } from './vpc-connector';
import { IAutoScalingConfiguration } from './auto-scaling-configuration';
import { IObservabilityConfiguration } from './observability-configuration';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* The image repository types
Expand Down Expand Up @@ -1267,6 +1268,8 @@ export class Service extends cdk.Resource implements IService, iam.IGrantable {

public constructor(scope: Construct, id: string, props: ServiceProps) {
super(scope, id);
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

const source = props.source.bind(this);
this.source = source;
Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-apprunner-alpha/lib/vpc-connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Connections } from 'aws-cdk-lib/aws-ec2';
import * as cdk from 'aws-cdk-lib/core';
import { Construct } from 'constructs';
import { CfnVpcConnector } from 'aws-cdk-lib/aws-apprunner';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* Properties of the AppRunner VPC Connector
Expand Down Expand Up @@ -135,6 +136,8 @@ export class VpcConnector extends cdk.Resource implements IVpcConnector {
super(scope, id, {
physicalName: props.vpcConnectorName,
});
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

if (props.vpcConnectorName !== undefined && !cdk.Token.isUnresolved(props.vpcConnectorName)) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as cdk from 'aws-cdk-lib/core';
import { Construct } from 'constructs';
import { IService } from './service';
import { CfnVpcIngressConnection } from 'aws-cdk-lib/aws-apprunner';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* Properties of the AppRunner VPC Ingress Connection
Expand Down Expand Up @@ -142,6 +143,8 @@ export class VpcIngressConnection extends cdk.Resource implements IVpcIngressCon
super(scope, id, {
physicalName: props.vpcIngressConnectionName,
});
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

if (props.vpcIngressConnectionName !== undefined && !cdk.Token.isUnresolved(props.vpcIngressConnectionName)) {

Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-cloud9-alpha/lib/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { IUser } from 'aws-cdk-lib/aws-iam';
import * as cdk from 'aws-cdk-lib/core';
import { Construct } from 'constructs';
import { CfnEnvironmentEC2 } from 'aws-cdk-lib/aws-cloud9';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* A Cloud9 Environment
Expand Down Expand Up @@ -197,6 +198,8 @@ export class Ec2Environment extends cdk.Resource implements IEc2Environment {

constructor(scope: Construct, id: string, props: Ec2EnvironmentProps) {
super(scope, id);
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

this.vpc = props.vpc;
if (!props.subnetSelection && this.vpc.publicSubnets.length === 0) {
Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-codestar-alpha/lib/github-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as s3 from 'aws-cdk-lib/aws-s3';
import * as cdk from 'aws-cdk-lib/core';
import { Construct } from 'constructs';
import * as codestar from 'aws-cdk-lib/aws-codestar';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* GitHubRepository resource interface
Expand Down Expand Up @@ -90,6 +91,8 @@ export class GitHubRepository extends cdk.Resource implements IGitHubRepository

constructor(scope: Construct, id: string, props: GitHubRepositoryProps) {
super(scope, id);
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

const resource = new codestar.CfnGitHubRepository(this, 'Resource', {
repositoryOwner: props.owner,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { IRole } from 'aws-cdk-lib/aws-iam';
import { Resource, IResource, Token } from 'aws-cdk-lib/core';
import { Construct } from 'constructs';
import { IIdentityPool, IdentityPoolProviderUrl } from './identitypool';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* Represents an Identity Pool Role Attachment
Expand Down Expand Up @@ -144,6 +145,8 @@ export class IdentityPoolRoleAttachment extends Resource implements IIdentityPoo

constructor(scope: Construct, id: string, props: IdentityPoolRoleAttachmentProps) {
super(scope, id);
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);
this.identityPoolId = props.identityPool.identityPoolId;
const mappings = props.roleMappings || [];
let roles: any = undefined, roleMappings: any = undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Resource, IResource, Stack, ArnFormat, Lazy, Token } from 'aws-cdk-lib/
import { Construct } from 'constructs';
import { IdentityPoolRoleAttachment, IdentityPoolRoleMapping } from './identitypool-role-attachment';
import { IUserPoolAuthenticationProvider } from './identitypool-user-pool-authentication-provider';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* Represents a Cognito Identity Pool
Expand Down Expand Up @@ -362,6 +363,8 @@ export class IdentityPool extends Resource implements IIdentityPool {
super(scope, id, {
physicalName: props.identityPoolName,
});
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);
const authProviders: IdentityPoolAuthenticationProviders = props.authenticationProviders || {};
const providers = authProviders.userPools ? authProviders.userPools.map(userPool => userPool.bind(this, this)) : undefined;
if (providers && providers.length) this.cognitoIdentityProviders = providers;
Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-ec2-alpha/lib/ipam.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { CfnIPAM, CfnIPAMPool, CfnIPAMPoolCidr, CfnIPAMScope } from 'aws-cdk-lib/aws-ec2';
import { Construct } from 'constructs';
import { Lazy, Names, Resource, Stack, Tags } from 'aws-cdk-lib';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* Represents the address family for IP addresses in an IPAM pool.
Expand Down Expand Up @@ -340,6 +341,8 @@ class IpamPool extends Resource implements IIpamPool {
produce: () => Names.uniqueResourceName(this, { maxLength: 128, allowedSpecialCharacters: '_' }),
}),
});
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

if (props.addressFamily === AddressFamily.IP_V6 && !props.awsService) {
throw new Error('awsService is required when addressFamily is set to ipv6');
Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-ec2-alpha/lib/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Annotations, Duration, IResource, Resource, Tags } from 'aws-cdk-lib/co
import { IVpcV2, VPNGatewayV2Options } from './vpc-v2-base';
import { NetworkUtils, allRouteTableIds, CidrBlock } from './util';
import { ISubnetV2 } from './subnet-v2';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* Indicates whether the NAT gateway supports public or private connectivity.
Expand Down Expand Up @@ -236,6 +237,8 @@ export class EgressOnlyInternetGateway extends Resource implements IRouteTarget

constructor(scope: Construct, id: string, props: EgressOnlyInternetGatewayProps) {
super(scope, id);
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

if (props.egressOnlyInternetGatewayName) {
Tags.of(this).add(NAME_TAG, props.egressOnlyInternetGatewayName);
Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-ec2-alpha/lib/subnet-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Construct, DependencyGroup, IDependable } from 'constructs';
import { IVpcV2 } from './vpc-v2-base';
import { CidrBlock, CidrBlockIpv6 } from './util';
import { RouteTable } from './route';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* Interface to define subnet CIDR
Expand Down Expand Up @@ -249,6 +250,8 @@ export class SubnetV2 extends Resource implements ISubnetV2 {
produce: () => Names.uniqueResourceName(this, { maxLength: 128, allowedSpecialCharacters: '_' }),
}),
});
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

const ipv4CidrBlock = props.ipv4CidrBlock.cidr;
const ipv6CidrBlock = props.ipv6CidrBlock?.cidr;
Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-ec2-alpha/lib/vpc-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { IpamOptions, IIpamPool } from './ipam';
import { IVpcV2, VpcV2Base } from './vpc-v2-base';
import { ISubnetV2, SubnetV2, SubnetV2Attributes } from './subnet-v2';
import { region_info } from 'aws-cdk-lib';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* Additional props needed for secondary Address
Expand Down Expand Up @@ -457,6 +458,8 @@ export class VpcV2 extends VpcV2Base {
produce: () => Names.uniqueResourceName(this, { maxLength: 128, allowedSpecialCharacters: '_' }),
}),
});
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);
this.vpcName = props.vpcName;
this.ipAddresses = props.primaryAddressBlock ?? IpAddresses.ipv4('10.0.0.0/16');
const vpcOptions = this.ipAddresses.allocateVpcCidr();
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-eks-v2-alpha/NOTICE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
AWS Cloud Development Kit (AWS CDK)
Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-eks-v2-alpha/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# EKS Alpha Module

Under development
Under development
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-gamelift-alpha/lib/alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Construct } from 'constructs';
import { IFleet } from './fleet-base';
import { IGameSessionQueueDestination } from './game-session-queue';
import { CfnAlias } from 'aws-cdk-lib/aws-gamelift';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* Represents a Gamelift Alias for a Gamelift fleet destination.
Expand Down Expand Up @@ -199,6 +200,8 @@ export class Alias extends AliasBase {
super(scope, id, {
physicalName: props.aliasName,
});
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

if (!cdk.Token.isUnresolved(props.aliasName)) {
if (props.aliasName.length > 1024) {
Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-gamelift-alpha/lib/build-fleet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { IBuild } from './build';
import { FleetBase, FleetProps, IFleet } from './fleet-base';
import { CfnFleet } from 'aws-cdk-lib/aws-gamelift';
import { Port, IPeer, IngressRule } from './ingress-rule';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* Represents a GameLift Fleet used to run a custom game build.
Expand Down Expand Up @@ -90,6 +91,8 @@ export class BuildFleet extends FleetBase implements IBuildFleet {
super(scope, id, {
physicalName: props.fleetName,
});
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

if (!cdk.Token.isUnresolved(props.fleetName)) {
if (props.fleetName.length > 1024) {
Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-gamelift-alpha/lib/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as cdk from 'aws-cdk-lib/core';
import { Construct } from 'constructs';
import { Content } from './content';
import { CfnBuild } from 'aws-cdk-lib/aws-gamelift';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* Your custom-built game server software that runs on GameLift and hosts game sessions for your players.
Expand Down Expand Up @@ -273,6 +274,8 @@ export class Build extends BuildBase {
super(scope, id, {
physicalName: props.buildName,
});
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

if (props.buildName && !cdk.Token.isUnresolved(props.buildName)) {
if (props.buildName.length > 1024) {
Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-gamelift-alpha/lib/game-server-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as iam from 'aws-cdk-lib/aws-iam';
import * as cdk from 'aws-cdk-lib/core';
import { Construct } from 'constructs';
import { CfnGameServerGroup } from 'aws-cdk-lib/aws-gamelift';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* Configuration settings for intelligent automatic scaling that uses target tracking.
Expand Down Expand Up @@ -424,6 +425,8 @@ export class GameServerGroup extends GameServerGroupBase {
super(scope, id, {
physicalName: props.gameServerGroupName,
});
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

if (!cdk.Token.isUnresolved(props.gameServerGroupName)) {
if (props.gameServerGroupName.length > 128) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as sns from 'aws-cdk-lib/aws-sns';
import * as cdk from 'aws-cdk-lib/core';
import { Construct } from 'constructs';
import { CfnGameSessionQueue } from 'aws-cdk-lib/aws-gamelift';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* Represents a game session queue destination
Expand Down Expand Up @@ -363,6 +364,8 @@ export class GameSessionQueue extends GameSessionQueueBase {
super(scope, id, {
physicalName: props.gameSessionQueueName,
});
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

if (!cdk.Token.isUnresolved(props.gameSessionQueueName)) {
if (props.gameSessionQueueName.length > 128) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as cdk from 'aws-cdk-lib/core';
import { Construct } from 'constructs';
import { CfnMatchmakingRuleSet } from 'aws-cdk-lib/aws-gamelift';
import { RuleSetContent } from './matchmaking-ruleset-body';
import { addConstructMetadata } from 'aws-cdk-lib/core/lib/metadata-resource';

/**
* Represents a Gamelift matchmaking ruleset
Expand Down Expand Up @@ -195,6 +196,8 @@ export class MatchmakingRuleSet extends MatchmakingRuleSetBase {
super(scope, id, {
physicalName: props.matchmakingRuleSetName,
});
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

if (!cdk.Token.isUnresolved(props.matchmakingRuleSetName)) {
if (props.matchmakingRuleSetName.length > 128) {
Expand Down
Loading

0 comments on commit 7f7d372

Please sign in to comment.