Skip to content

Commit

Permalink
Attempt to fix merge conflicts
Browse files Browse the repository at this point in the history
This is part of an attempt to revive
aws#22573, because it's similar to the
anticipated fix for aws#21197.
  • Loading branch information
douglasnaphas committed May 31, 2023
1 parent 08ad189 commit c7fc3cb
Show file tree
Hide file tree
Showing 14 changed files with 1,841 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { EbsDeviceVolumeType } from 'aws-cdk-lib/aws-ec2';
import * as iam from 'aws-cdk-lib/aws-iam';
import { App, RemovalPolicy, Stack, StackProps } from 'aws-cdk-lib';
import { EbsDeviceVolumeType } from '@aws-cdk/aws-ec2';
import * as iam from '@aws-cdk/aws-iam';
import { App, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core';
import * as cxapi from '@aws-cdk/cx-api';
import { Construct } from 'constructs';
import * as opensearch from 'aws-cdk-lib/aws-opensearchservice';

Expand Down Expand Up @@ -45,6 +46,6 @@ class TestStack extends Stack {
}
}

const app = new App();
const app = new App({ postCliContext: { [cxapi.OPENSEARCH_DISABLE_LOG_CUSTOM_RESOURCE]: false } });
new TestStack(app, 'cdk-integ-opensearch');
app.synth();
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { EbsDeviceVolumeType } from '@aws-cdk/aws-ec2';
import * as iam from '@aws-cdk/aws-iam';
import { App, RemovalPolicy, Stack, StackProps } from '@aws-cdk/core';
import { IntegTest } from '@aws-cdk/integ-tests';
import { Construct } from 'constructs';
import * as opensearch from '../lib';

class TestStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);

const domainProps: opensearch.DomainProps = {
removalPolicy: RemovalPolicy.DESTROY,
version: opensearch.EngineVersion.ELASTICSEARCH_7_1,
ebs: {
volumeSize: 10,
volumeType: EbsDeviceVolumeType.GENERAL_PURPOSE_SSD,
},
logging: {
slowSearchLogEnabled: true,
appLogEnabled: true,
},
nodeToNodeEncryption: true,
encryptionAtRest: {
enabled: true,
},
advancedOptions: {
'rest.action.multi.allow_explicit_index': 'false',
'indices.fielddata.cache.size': '25',
'indices.query.bool.max_clause_count': '2048',
},
// test the access policies custom resource works
accessPolicies: [
new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
actions: ['es:ESHttp*'],
principals: [new iam.AccountRootPrincipal()],
resources: ['*'],
}),
],
};

// create 2 domains to ensure that Cloudwatch Log Group policy names dont conflict
new opensearch.Domain(this, 'Domain1', domainProps);
new opensearch.Domain(this, 'Domain2', domainProps);
}
}

const app = new App();
const stack = new TestStack(app, 'cdk-integ-opensearch-withoutcustomresource');

new IntegTest(app, 'Integ', { testCases: [stack] });
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "21.0.0",
"files": {
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
"source": {
"path": "IntegDefaultTestDeployAssert4E6713E1.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
}
},
"dockerImages": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"version": "21.0.0",
"files": {
"105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286": {
"source": {
"path": "asset.105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"e616d66bad7edaed130c1bbe89c671fa8cf35a465972ce0dc66d5cb070cf256f": {
"source": {
"path": "cdk-integ-opensearch-withoutcustomresource.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "e616d66bad7edaed130c1bbe89c671fa8cf35a465972ce0dc66d5cb070cf256f.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
}
},
"dockerImages": {}
}
Loading

0 comments on commit c7fc3cb

Please sign in to comment.