Skip to content

Commit

Permalink
Merge branch 'main' into TheRealAmazonKendra/es-test-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Aug 16, 2022
2 parents 03656d2 + e53c4f7 commit 2b25ae8
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import * as ec2 from '@aws-cdk/aws-ec2';
import { App, Stack, StackProps, RemovalPolicy } from '@aws-cdk/core';
import { App, Stack, StackProps, RemovalPolicy, CfnResource } from '@aws-cdk/core';
import * as integ 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 serviceLinkedRole = new CfnResource(this, 'ServiceLinkedRole', {
type: 'AWS::IAM::ServiceLinkedRole',
properties: {
AWSServiceName: 'opensearchservice.amazonaws.com',
Description: 'Role for OpenSearch VPC Test',
},
});

const vpc = new ec2.Vpc(this, 'Vpc');
const domainProps: opensearch.DomainProps = {
version: opensearch.EngineVersion.ELASTICSEARCH_7_1,
Expand All @@ -19,10 +28,15 @@ class TestStack extends Stack {
dataNodes: 2,
},
};
new opensearch.Domain(this, 'Domain', domainProps);

const domain = new opensearch.Domain(this, 'Domain', domainProps);
domain.node.addDependency(serviceLinkedRole);
}
}

const app = new App();
new TestStack(app, 'cdk-integ-opensearch-vpc');
const testCase = new TestStack(app, 'cdk-integ-opensearch-vpc');
new integ.IntegTest(app, 'cdk-integ-opensearch-vpc-test', {
testCases: [testCase],
});
app.synth();
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"Resources": {
"ServiceLinkedRole": {
"Type": "AWS::IAM::ServiceLinkedRole",
"Properties": {
"AWSServiceName": "opensearchservice.amazonaws.com",
"Description": "Role for OpenSearch VPC Test"
}
},
"Vpc8378EB38": {
"Type": "AWS::EC2::VPC",
"Properties": {
Expand Down Expand Up @@ -397,7 +404,10 @@
"VpcId": {
"Ref": "Vpc8378EB38"
}
}
},
"DependsOn": [
"ServiceLinkedRole"
]
},
"Domain66AC69E0": {
"Type": "AWS::OpenSearchService::Domain",
Expand Down Expand Up @@ -447,6 +457,9 @@
]
}
},
"DependsOn": [
"ServiceLinkedRole"
],
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"version": "20.0.0",
"testCases": {
"integ.opensearch.vpc": {
"cdk-integ-opensearch-vpc-test/DefaultTest": {
"stacks": [
"cdk-integ-opensearch-vpc"
],
"diffAssets": false,
"stackUpdateWorkflow": true
"assertionStack": "cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2"
}
},
"synthContext": {},
"enableLookups": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
"validateOnSynth": false
},
"metadata": {
"/cdk-integ-opensearch-vpc/ServiceLinkedRole": [
{
"type": "aws:cdk:logicalId",
"data": "ServiceLinkedRole"
}
],
"/cdk-integ-opensearch-vpc/Vpc/Resource": [
{
"type": "aws:cdk:logicalId",
Expand Down Expand Up @@ -167,6 +173,15 @@
]
},
"displayName": "cdk-integ-opensearch-vpc"
},
"cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2": {
"type": "aws:cloudformation:stack",
"environment": "aws://unknown-account/unknown-region",
"properties": {
"templateFile": "cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.template.json",
"validateOnSynth": false
},
"displayName": "cdk-integ-opensearch-vpc-test/DefaultTest/DeployAssert"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,21 @@
"path": "Tree",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.58"
"version": "10.1.71"
}
},
"cdk-integ-opensearch-vpc": {
"id": "cdk-integ-opensearch-vpc",
"path": "cdk-integ-opensearch-vpc",
"children": {
"ServiceLinkedRole": {
"id": "ServiceLinkedRole",
"path": "cdk-integ-opensearch-vpc/ServiceLinkedRole",
"constructInfo": {
"fqn": "@aws-cdk/core.CfnResource",
"version": "0.0.0"
}
},
"Vpc": {
"id": "Vpc",
"path": "cdk-integ-opensearch-vpc/Vpc",
Expand Down Expand Up @@ -765,6 +773,42 @@
"fqn": "@aws-cdk/core.Stack",
"version": "0.0.0"
}
},
"cdk-integ-opensearch-vpc-test": {
"id": "cdk-integ-opensearch-vpc-test",
"path": "cdk-integ-opensearch-vpc-test",
"children": {
"DefaultTest": {
"id": "DefaultTest",
"path": "cdk-integ-opensearch-vpc-test/DefaultTest",
"children": {
"Default": {
"id": "Default",
"path": "cdk-integ-opensearch-vpc-test/DefaultTest/Default",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.1.71"
}
},
"DeployAssert": {
"id": "DeployAssert",
"path": "cdk-integ-opensearch-vpc-test/DefaultTest/DeployAssert",
"constructInfo": {
"fqn": "@aws-cdk/core.Stack",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/integ-tests.IntegTestCase",
"version": "0.0.0"
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/integ-tests.IntegTest",
"version": "0.0.0"
}
}
},
"constructInfo": {
Expand Down

0 comments on commit 2b25ae8

Please sign in to comment.