forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is part of an attempt to revive aws#22573, because it's similar to the anticipated fix for aws#21197.
- Loading branch information
1 parent
08ad189
commit c7fc3cb
Showing
14 changed files
with
1,841 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.withoutcustomresource.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] }); |
19 changes: 19 additions & 0 deletions
19
...rch.withoutcustomresource.integ.snapshot/IntegDefaultTestDeployAssert4E6713E1.assets.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": {} | ||
} |
36 changes: 36 additions & 0 deletions
36
...h.withoutcustomresource.integ.snapshot/IntegDefaultTestDeployAssert4E6713E1.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." | ||
} | ||
] | ||
} | ||
} | ||
} |
252 changes: 252 additions & 0 deletions
252
....snapshot/asset.105b4f39ae68785e705640aa91919e412fcba2dd454aca53412747be8d955286/index.js
Large diffs are not rendered by default.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
...thoutcustomresource.integ.snapshot/cdk-integ-opensearch-withoutcustomresource.assets.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": {} | ||
} |
Oops, something went wrong.