Skip to content

Commit

Permalink
Merge branch 'main' into metrics-config
Browse files Browse the repository at this point in the history
  • Loading branch information
jonife authored Nov 18, 2024
2 parents dcd8862 + b70ad52 commit 2577ec1
Show file tree
Hide file tree
Showing 28 changed files with 11,154 additions and 15,298 deletions.
11 changes: 11 additions & 0 deletions packages/@aws-cdk-testing/cli-integ/resources/cdk-apps/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,15 @@ class AppSyncHotswapStack extends cdk.Stack {
}
}

class MetadataStack extends cdk.Stack {
constructor(parent, id, props) {
super(parent, id, props);
const handle = new cdk.CfnWaitConditionHandle(this, 'WaitConditionHandle');
handle.addMetadata('Key', process.env.INTEG_METADATA_VALUE ?? 'default')

}
}

const app = new cdk.App({
context: {
'@aws-cdk/core:assetHashSalt': process.env.CODEBUILD_BUILD_ID, // Force all assets to be unique, but consistent in one build
Expand Down Expand Up @@ -877,6 +886,8 @@ switch (stackSet) {
new ExportValueStack(app, `${stackPrefix}-export-value-stack`);

new BundlingStage(app, `${stackPrefix}-bundling-stage`);

new MetadataStack(app, `${stackPrefix}-metadata`);
break;

case 'stage-using-context':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,46 @@ integTest(
}),
);

integTest(
'cdk diff doesnt show resource metadata changes',
withDefaultFixture(async (fixture) => {

// GIVEN - small initial stack with default resource metadata
await fixture.cdkDeploy('metadata');

// WHEN - changing resource metadata value
const diff = await fixture.cdk(['diff', fixture.fullStackName('metadata')], {
verbose: true,
modEnv: {
INTEG_METADATA_VALUE: 'custom',
},
});

// Assert there are no changes
expect(diff).toContain('There were no differences');
}),
);

integTest(
'cdk diff shows resource metadata changes with --no-change-set',
withDefaultFixture(async (fixture) => {

// GIVEN - small initial stack with default resource metadata
await fixture.cdkDeploy('metadata');

// WHEN - changing resource metadata value
const diff = await fixture.cdk(['diff --no-change-set', fixture.fullStackName('metadata')], {
verbose: true,
modEnv: {
INTEG_METADATA_VALUE: 'custom',
},
});

// Assert there are changes
expect(diff).not.toContain('There were no differences');
}),
);

integTest('cdk diff with large changeset and custom toolkit stack name and qualifier does not fail', withoutBootstrap(async (fixture) => {
// Bootstrapping with custom toolkit stack name and qualifier
const qualifier = 'abc1111';
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,37 @@
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"OpenSearch2174B754FE5": {
"Type": "AWS::OpenSearchService::Domain",
"Properties": {
"ClusterConfig": {
"DedicatedMasterEnabled": false,
"InstanceCount": 1,
"InstanceType": "r5.large.search",
"MultiAZWithStandbyEnabled": false,
"ZoneAwarenessEnabled": false
},
"DomainEndpointOptions": {
"EnforceHTTPS": false,
"TLSSecurityPolicy": "Policy-Min-TLS-1-0-2019-07"
},
"EBSOptions": {
"EBSEnabled": true,
"VolumeSize": 10,
"VolumeType": "gp2"
},
"EncryptionAtRestOptions": {
"Enabled": false
},
"EngineVersion": "OpenSearch_2.17",
"LogPublishingOptions": {},
"NodeToNodeEncryptionOptions": {
"Enabled": false
}
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
}
},
"Parameters": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class TestStack extends Stack {
const versions = [
opensearch.EngineVersion.OPENSEARCH_2_13,
opensearch.EngineVersion.OPENSEARCH_2_15,
opensearch.EngineVersion.OPENSEARCH_2_17,
];

// deploy opensearch domain with minimal configuration
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-scheduler-targets-alpha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ The code snippet below creates an event rule with a delivery stream as a target
called every hour by EventBridge Scheduler with a custom payload.

```ts
import * as firehose from 'aws-cdk-lib/aws-kinesisfirehose';
declare const deliveryStream: firehose.CfnDeliveryStream;
import * as firehose from '@aws-cdk/aws-kinesisfirehose-alpha';
declare const deliveryStream: firehose.IDeliveryStream;

const payload = {
Data: "record",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { IDeliveryStream } from '@aws-cdk/aws-kinesisfirehose-alpha';
import { IScheduleTarget } from '@aws-cdk/aws-scheduler-alpha';
import { IRole, PolicyStatement } from 'aws-cdk-lib/aws-iam';
import { CfnDeliveryStream } from 'aws-cdk-lib/aws-kinesisfirehose';
import { ScheduleTargetBase, ScheduleTargetBaseProps } from './target';

/**
* Use an Amazon Kinesis Data Firehose as a target for AWS EventBridge Scheduler.
*/
export class KinesisDataFirehosePutRecord extends ScheduleTargetBase implements IScheduleTarget {
constructor(
private readonly deliveryStream: CfnDeliveryStream,
private readonly deliveryStream: IDeliveryStream,
props: ScheduleTargetBaseProps = {},
) {
super(props, deliveryStream.attrArn);
super(props, deliveryStream.deliveryStreamArn);
}

protected addTargetActionToRole(role: IRole): void {

role.addToPrincipalPolicy(new PolicyStatement({
actions: ['firehose:PutRecord'],
resources: [this.deliveryStream.attrArn],
resources: [this.deliveryStream.deliveryStreamArn],
}));
}
}
12 changes: 8 additions & 4 deletions packages/@aws-cdk/aws-scheduler-targets-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,23 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/aws-kinesisfirehose-destinations-alpha": "0.0.0",
"@aws-cdk/aws-kinesisfirehose-alpha": "0.0.0",
"@aws-cdk/aws-scheduler-alpha": "0.0.0",
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/integ-tests-alpha": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^29.5.14",
"aws-cdk-lib": "0.0.0",
"@aws-cdk/aws-scheduler-alpha": "0.0.0",
"constructs": "^10.0.0",
"@aws-cdk/integ-tests-alpha": "0.0.0"
"constructs": "^10.0.0"
},
"dependencies": {},
"peerDependencies": {
"aws-cdk-lib": "^0.0.0",
"@aws-cdk/aws-kinesisfirehose-destinations-alpha": "0.0.0",
"@aws-cdk/aws-kinesisfirehose-alpha": "0.0.0",
"@aws-cdk/aws-scheduler-alpha": "0.0.0",
"aws-cdk-lib": "^0.0.0",
"constructs": "^10.0.0"
},
"engines": {
Expand Down
Loading

0 comments on commit 2577ec1

Please sign in to comment.