Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(eslint): enforce spacing at beginning of comments #33077

Merged
merged 17 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,8 @@ integTest('doubly nested stack',
await fixture.cdkDeploy('with-doubly-nested-stack', {
captureStderr: false,
});
}));
}),
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just a me fix :) plz don't make me pull it out into a separate PR


integTest(
'nested stack with parameters',
Expand Down Expand Up @@ -406,7 +407,7 @@ integTest(
);
expect(response.Stacks?.[0].StackStatus).toEqual('REVIEW_IN_PROGRESS');

//verify a change set was created with the provided name
// verify a change set was created with the provided name
const changeSetResponse = await fixture.aws.cloudFormation.send(
new ListChangeSetsCommand({
StackName: stackArn,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const app = new cdk.App();
class TestStack extends cdk.Stack {
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
super(scope, id, props);
this.node.setContext(BASTION_HOST_USE_AMAZON_LINUX_2023_BY_DEFAULT, false); //disable feature flag
this.node.setContext(BASTION_HOST_USE_AMAZON_LINUX_2023_BY_DEFAULT, false); // disable feature flag

const vpc = new ec2.Vpc(this, 'VPC');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const describeInfrequentAccess = integTest.assertions.awsApiCall('CloudWatchLogs
logGroupNamePrefix: logGroupInfrequentAccess.logGroupName,
});

//valdiate
// valdiate
describeInfrequentAccess.expect(ExpectedResult.objectLike({
logGroups: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const prompt3 = new BedrockInvokeModel(stack, 'Prompt3', {
});

/** Test for Bedrock s3 URI Path */
//State Machine Execution will fail for the following input as it expects a valid s3 URI from previous prompt
// State Machine Execution will fail for the following input as it expects a valid s3 URI from previous prompt
const prompt4 = new BedrockInvokeModel(stack, 'Prompt4', {
model,
input: { s3InputUri: '$.names' },
Expand Down Expand Up @@ -144,7 +144,7 @@ const llamaPrompt3 = new BedrockInvokeModel(stack, 'LlamaPrompt3', {
});

/** Test for Bedrock s3 URI Path */
//State Machine Execution will fail for the following input as it expects a valid s3 URI from previous prompt
// State Machine Execution will fail for the following input as it expects a valid s3 URI from previous prompt
const llamaModel4 = bedrock.FoundationModel.fromFoundationModelId(stack, 'LlamaModel4', bedrock.FoundationModelIdentifier.META_LLAMA_3_2_90B_INSTRUCT_V1);
const llamaPrompt4 = new BedrockInvokeModel(stack, 'LlamaPrompt4', {
model: llamaModel4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const testCase = new IntegTest(app, 'StateMachineAndActivityWithCMKEncryptionCon
testCases: [stack],
});

//Start execution
// Start execution
const start = testCase.assertions.awsApiCall('StepFunctions', 'startExecution', {
stateMachineArn: stack.stateMachine.stateMachineArn,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IntegTest } from '@aws-cdk/integ-tests-alpha';

const app = new cdk.App();

const stack = new cdk.Stack(app, 'core-cfn-mapping-1'/*,{ env }*/);
const stack = new cdk.Stack(app, 'core-cfn-mapping-1'/* ,{ env }*/);

const backing = {
TopLevelKey1: {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ec2-alpha/lib/ipam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ class IpamPool extends Resource implements IIpamPool {
throw new Error('awsService is required when addressFamily is set to ipv6');
}

//Add tags to the IPAM Pool if name is provided
// Add tags to the IPAM Pool if name is provided
if (props.ipamPoolName) {
Tags.of(this).add(NAME_TAG, props.ipamPoolName);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-ec2-alpha/lib/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ export class Route extends Resource implements IRouteV2 {
this.destination = props.destination;
const isDestinationIpv4 = NetworkUtils.validIp(props.destination);
if (!isDestinationIpv4) {
//TODO Validate for IPv6 CIDR range
// TODO Validate for IPv6 CIDR range
this.destinationIpv6Cidr = props.destination;
} else {
this.destinationIpv4Cidr = props.destination;
Expand All @@ -745,7 +745,7 @@ export class Route extends Resource implements IRouteV2 {
}
this.node.defaultChild = this.resource;

//Create a route only after target gateway or endpoint is created
// Create a route only after target gateway or endpoint is created
if (this.target.gateway) {
this.node.addDependency(this.target.gateway);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ec2-alpha/lib/subnet-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export class SubnetV2 extends Resource implements ISubnetV2 {

overlap = validateOverlappingCidrRanges(props.vpc, props.ipv4CidrBlock.cidr);

//check whether VPC supports ipv6
// check whether VPC supports ipv6
if (props.ipv6CidrBlock?.cidr) {
validateSupportIpv6(props.vpc);
overlapIpv6 = validateOverlappingCidrRangesipv6(props.vpc, props.ipv6CidrBlock?.cidr);
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ec2-alpha/lib/util.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*eslint no-bitwise: ["error", { "allow": ["~", "|", "<<", "&"] }] */
/* eslint no-bitwise: ["error", { "allow": ["~", "|", "<<", "&"] }] */

import { ISubnet } from 'aws-cdk-lib/aws-ec2';

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ec2-alpha/lib/vpc-v2-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ export abstract class VpcV2Base extends Resource implements IVpcV2 {
routeName: 'CDKDefaultIPv6Route',
});
}
//Add default route to IGW for IPv4
// Add default route to IGW for IPv4
new Route(this, `${subnet.node.id}-DefaultRoute`, {
routeTable: subnet.routeTable,
destination: options?.ipv4Destination ?? '0.0.0.0/0',
Expand Down
18 changes: 9 additions & 9 deletions packages/@aws-cdk/aws-ec2-alpha/lib/vpc-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ export class VpcV2 extends VpcV2Base {
this.dnsSupportEnabled = props.enableDnsSupport == null ? true : props.enableDnsSupport;
const instanceTenancy = props.defaultInstanceTenancy || 'default';
this.resource = new CfnVPC(this, 'Resource', {
cidrBlock: vpcOptions.ipv4CidrBlock, //for Ipv4 addresses CIDR block
cidrBlock: vpcOptions.ipv4CidrBlock, // for Ipv4 addresses CIDR block
enableDnsHostnames: this.dnsHostnamesEnabled,
enableDnsSupport: this.dnsSupportEnabled,
ipv4IpamPoolId: vpcOptions.ipv4IpamPool?.ipamPoolId, // for Ipv4 ipam option
Expand All @@ -529,7 +529,7 @@ export class VpcV2 extends VpcV2Base {
}, this.stack);
this.region = this.stack.region;
this.ownerAccountId = this.stack.account;
//Add tag to the VPC with the name provided in properties
// Add tag to the VPC with the name provided in properties
Tags.of(this).add(NAME_TAG, props.vpcName || this.node.path);
if (props.secondaryAddressBlocks) {
const secondaryAddressBlocks: IIpAddresses[] = props.secondaryAddressBlocks;
Expand All @@ -544,7 +544,7 @@ export class VpcV2 extends VpcV2Base {
if (secondaryVpcOptions.amazonProvided || secondaryVpcOptions.ipv6IpamPool || secondaryVpcOptions.ipv6PoolId) {
this.useIpv6 = true;
}
//validate CIDR ranges per RFC 1918
// validate CIDR ranges per RFC 1918
if (secondaryVpcOptions.ipv4CidrBlock!) {
const ret = validateIpv4address(secondaryVpcOptions.ipv4CidrBlock, this.resource.cidrBlock);
if (ret === false) {
Expand All @@ -562,17 +562,17 @@ export class VpcV2 extends VpcV2Base {
ipv6NetmaskLength: secondaryVpcOptions.ipv6NetmaskLength,
ipv6IpamPoolId: secondaryVpcOptions.ipv6IpamPool?.ipamPoolId,
amazonProvidedIpv6CidrBlock: secondaryVpcOptions.amazonProvided,
//BYOIP IPv6 Address
// BYOIP IPv6 Address
ipv6CidrBlock: secondaryVpcOptions?.ipv6CidrBlock,
//BYOIP Pool for IPv6 address
// BYOIP Pool for IPv6 address
ipv6Pool: secondaryVpcOptions?.ipv6PoolId,
});
if (secondaryVpcOptions.dependencies) {
for (const dep of secondaryVpcOptions.dependencies) {
vpcCidrBlock.node.addDependency(dep);
}
}
//Create secondary blocks for Ipv4 and Ipv6
// Create secondary blocks for Ipv4 and Ipv6
this.secondaryCidrBlock?.push(vpcCidrBlock);
}
}
Expand Down Expand Up @@ -835,7 +835,7 @@ class VPCCidrBlock extends Resource implements IVPCCidrBlock {
public readonly amazonProvidedIpv6CidrBlock ?: boolean = props.amazonProvidedIpv6CidrBlock;
public readonly ipv6IpamPoolId ?: string = props.ipv6IpamPoolId;
public readonly ipv4IpamPoolId ?: string = props.ipv4IpamPoolId;
//BYOIP Pool Attributes
// BYOIP Pool Attributes
public readonly ipv6Pool?: string = props.ipv6Pool;
public readonly ipv6CidrBlock?: string = props.ipv6CidrBlock;
}
Expand Down Expand Up @@ -864,13 +864,13 @@ class VPCCidrBlock extends Resource implements IVPCCidrBlock {
this.ipv6IpamPoolId = props.ipv6IpamPoolId;
this.ipv4IpamPoolId = props.ipv4IpamPoolId;
this.amazonProvidedIpv6CidrBlock = props.amazonProvidedIpv6CidrBlock;
//BYOIP Pool and CIDR Block
// BYOIP Pool and CIDR Block
this.ipv6CidrBlock = props.ipv6CidrBlock;
this.ipv6Pool = props.ipv6Pool;
}
}

//@internal First two Octet to verify RFC 1918
// @internal First two Octet to verify RFC 1918
interface IPaddressConfig {
octet1: number;
octet2: number;
Expand Down
8 changes: 4 additions & 4 deletions packages/@aws-cdk/aws-ec2-alpha/test/integ.byoip-ipv6.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const myVpc = new vpc_v2.VpcV2(stack, 'VPC-integ-test-1', {
primaryAddressBlock: vpc_v2.IpAddresses.ipv4('10.1.0.0/16'),
secondaryAddressBlocks: [
vpc_v2.IpAddresses.ipv6ByoipPool({
ipv6PoolId: 'ipv6pool-ec2-0a95217e154b65493', //To Be Replaced
ipv6PoolId: 'ipv6pool-ec2-0a95217e154b65493', // To Be Replaced
cidrBlockName: 'MyByoipIpv6Block',
ipv6CidrBlock: '2600:f0f0:8::/56', //To Be Replaced
ipv6CidrBlock: '2600:f0f0:8::/56', // To Be Replaced
}),
],
enableDnsHostnames: true,
Expand All @@ -33,7 +33,7 @@ const myVpc = new vpc_v2.VpcV2(stack, 'VPC-integ-test-1', {
new SubnetV2(stack, 'Subnet-integ-test-1', {
vpc: myVpc,
ipv4CidrBlock: new IpCidr('10.1.1.0/24'),
ipv6CidrBlock: new IpCidr('2600:f0f0:8:1::/64'), //To Be Replaced
ipv6CidrBlock: new IpCidr('2600:f0f0:8:1::/64'), // To Be Replaced
availabilityZone: 'us-west-2a',
subnetType: SubnetType.PRIVATE_ISOLATED,
});
Expand All @@ -44,7 +44,7 @@ new SubnetV2(stack, 'Subnet-integ-test-1', {
new SubnetV2(stack, 'Subnet-integ-test-2', {
vpc: myVpc,
ipv4CidrBlock: new IpCidr('10.1.0.0/24'),
ipv6CidrBlock: new IpCidr('2600:f0f0:8:0::/64'), //To Be Replaced
ipv6CidrBlock: new IpCidr('2600:f0f0:8:0::/64'), // To Be Replaced
availabilityZone: 'us-west-2a',
subnetType: SubnetType.PRIVATE_ISOLATED,
});
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-ec2-alpha/test/integ.ipam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const ipam = new Ipam(stack, 'IpamTest', {
operatingRegion: ['us-west-2'],
});

/**Test Ipam Pool Ipv4 */
/** Test Ipam Pool Ipv4 */

const pool1 = ipam.privateScope.addPool('PrivatePool0', {
addressFamily: AddressFamily.IP_V4,
Expand Down Expand Up @@ -70,8 +70,8 @@ new SubnetV2(stack, 'testsbubnet', {
vpc,
availabilityZone: 'us-west-2a',
ipv4CidrBlock: new IpCidr('10.0.0.0/24'),
//defined on the basis of allocation done in IPAM console
//ipv6CidrBlock: new Ipv6Cidr('2a05:d02c:25:4000::/60'),
// defined on the basis of allocation done in IPAM console
// ipv6CidrBlock: new Ipv6Cidr('2a05:d02c:25:4000::/60'),
subnetType: SubnetType.PRIVATE_ISOLATED,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class AcceptorStack extends cdk.Stack {
primaryAddressBlock: vpc_v2.IpAddresses.ipv4('10.0.0.0/16'),
});

//Same account VPC peering
// Same account VPC peering
const requestorVpc = new vpc_v2.VpcV2(this, 'requestorVpcSameAccount', {
primaryAddressBlock: vpc_v2.IpAddresses.ipv4('10.1.0.0/16'),
});
Expand All @@ -60,7 +60,7 @@ class AcceptorStack extends cdk.Stack {
acceptorVpc: acceptorVpc,
});

//For cross-account peering connection
// For cross-account peering connection
acceptorVpc.createAcceptorVpcRole(account);
}
}
Expand All @@ -69,9 +69,9 @@ class RequestorStack extends cdk.Stack {
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);

//Import acceptorVpc into the requestor stack, change vpcId after vpc is created using acceptorStack definition
// Import acceptorVpc into the requestor stack, change vpcId after vpc is created using acceptorStack definition
const acceptorVpc = vpc_v2.VpcV2.fromVpcV2Attributes(this, 'acceptorVpc', {
//Replace VPC Id before running integ test again
// Replace VPC Id before running integ test again
vpcId: 'vpc-09b9235d8a3195ba3',
vpcCidrBlock: '10.0.0.0/16',
region: 'us-east-1',
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-ec2-alpha/test/integ.subnet-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ new SubnetV2(stack, 'testSubnet1', {
vpc,
availabilityZone: 'us-west-2a',
ipv4CidrBlock: new IpCidr('10.1.0.0/20'),
//defined on the basis of allocation done in IPAM console
//ipv6CidrBlock: new Ipv6Cidr('2a05:d02c:25:4000::/60'),
// defined on the basis of allocation done in IPAM console
// ipv6CidrBlock: new Ipv6Cidr('2a05:d02c:25:4000::/60'),
subnetType: SubnetType.PRIVATE_ISOLATED,
});

/**Test compatibility with existing construct */
/** Test compatibility with existing construct */
new ec2.Instance(stack, 'Instance', {
vpc,
instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.MICRO),
Expand Down
26 changes: 13 additions & 13 deletions packages/@aws-cdk/aws-ec2-alpha/test/integ.test-import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const stack = new cdk.Stack(app, 'vpcv2-import-integ-test', {
* according to the one alloted on creation
*/
const imported_new_vpc = VpcV2.VpcV2.fromVpcV2Attributes(stack, 'ImportedNewVPC', {
vpcId: 'vpc-08193db3ccc4f909f', //VPC id
vpcId: 'vpc-08193db3ccc4f909f', // VPC id
vpcCidrBlock: '10.1.0.0/16',
secondaryCidrBlocks: [{
cidrBlock: '10.2.0.0/16',
Expand All @@ -34,11 +34,11 @@ const imported_new_vpc = VpcV2.VpcV2.fromVpcV2Attributes(stack, 'ImportedNewVPC'
}],
subnets: [{
subnetName: 'IsolatedSubnet2',
subnetId: 'subnet-03cd773c0fe08ed26', //Subnet Id
subnetId: 'subnet-03cd773c0fe08ed26', // Subnet Id
subnetType: SubnetType.PRIVATE_ISOLATED,
availabilityZone: 'us-west-2a',
ipv4CidrBlock: '10.2.0.0/24',
routeTableId: 'rtb-0871c310f98da2cbb', //RouteTable id
routeTableId: 'rtb-0871c310f98da2cbb', // RouteTable id
}, {
subnetId: 'subnet-0fa477e01db27d820',
subnetType: SubnetType.PUBLIC,
Expand All @@ -48,22 +48,22 @@ const imported_new_vpc = VpcV2.VpcV2.fromVpcV2Attributes(stack, 'ImportedNewVPC'
}],
});

//Test to add new subnet to imported VPC against secondary range
// Test to add new subnet to imported VPC against secondary range
new SubnetV2(stack, 'AddnewImportedSubnet', {
availabilityZone: 'us-west-2a',
ipv4CidrBlock: new IpCidr('10.2.2.0/24'),
//can be uncommented and modified after allocation is done using Amazon Provided Ipv6
//ipv6CidrBlock: new IpCidr('2600:1f14:b1d:6500::/64'),
// can be uncommented and modified after allocation is done using Amazon Provided Ipv6
// ipv6CidrBlock: new IpCidr('2600:1f14:b1d:6500::/64'),
vpc: imported_new_vpc,
subnetType: SubnetType.PUBLIC,
});

//Test to add new subnet to imported VPC against secondary range
// Test to add new subnet to imported VPC against secondary range
new SubnetV2(stack, 'AddnewImportedSubnet2', {
availabilityZone: 'us-west-2a',
ipv4CidrBlock: new IpCidr('10.3.2.0/24'),
//can be uncommented and modified after allocation is done using Amazon Provided Ipv6
//ipv6CidrBlock: new IpCidr('2600:1f14:b1d:6500::/64'),
// can be uncommented and modified after allocation is done using Amazon Provided Ipv6
// ipv6CidrBlock: new IpCidr('2600:1f14:b1d:6500::/64'),
vpc: imported_new_vpc,
subnetType: SubnetType.PUBLIC,
});
Expand All @@ -76,7 +76,7 @@ const ImportedSubnet = SubnetV2.fromSubnetV2Attributes(stack, 'IsolatedSubnet1',
routeTableId: 'rtb-0f02fab3ed3fb4ba9',
});

//Test to add different types of gateways
// Test to add different types of gateways
imported_new_vpc.addInternetGateway();

imported_new_vpc.addNatGateway({
Expand All @@ -101,14 +101,14 @@ const ipamvpc = VpcV2.VpcV2.fromVpcV2Attributes(stack, 'ImportedIPAMVPC', {
}],
});

//Test to add different types of gateways
// Test to add different types of gateways
ipamvpc.addEgressOnlyInternetGateway();

//Test to add new subnet to imported VPC against IPAM range
// Test to add new subnet to imported VPC against IPAM range
new SubnetV2(stack, 'AddnewSubnettoImportedIpam', {
availabilityZone: 'us-west-2a',
ipv4CidrBlock: new IpCidr('10.2.1.0/28'),
//can be uncommented and modified after allocation is done using IPAM - Amazon Provided Ipv6
// can be uncommented and modified after allocation is done using IPAM - Amazon Provided Ipv6
ipv6CidrBlock: new IpCidr('2600:1f24:6c:4000::/64'),
vpc: ipamvpc,
subnetType: SubnetType.PUBLIC,
Expand Down
Loading
Loading