Skip to content

Commit 1a082f4

Browse files
mergify[bot]njlynch
authored andcommitted
chore: forward merge 'master' into 'v2-main' (#13730)
Automated action from aws/cdk-ops
2 parents 3373785 + ecffdf5 commit 1a082f4

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

packages/@aws-cdk/aws-elasticsearch/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,30 @@ const prodDomain = new es.Domain(this, 'Domain', {
7474
This creates an Elasticsearch cluster and automatically sets up log groups for
7575
logging the domain logs and slow search logs.
7676

77+
## A note about SLR
78+
79+
Some cluster configurations (e.g VPC access) require the existence of the [`AWSServiceRoleForAmazonElasticsearchService`](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/slr-es.html) Service-Linked Role.
80+
81+
When performing such operations via the AWS Console, this SLR is created automatically when needed. However, this is not the behavior when using CloudFormation. If an SLR is needed, but doesn't exist, you will encounter a failure message simlar to:
82+
83+
```console
84+
Before you can proceed, you must enable a service-linked role to give Amazon ES...
85+
```
86+
87+
To resolve this, you need to [create](https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html#create-service-linked-role) the SLR. We recommend using the AWS CLI:
88+
89+
```console
90+
aws iam create-service-linked-role --aws-service-name es.amazonaws.com
91+
```
92+
93+
You can also create it using the CDK, **but note that only the first application deploying this will succeed**:
94+
95+
```ts
96+
const slr = new iam.CfnServiceLinkedRole(this, 'ElasticSLR', {
97+
awsServiceName: 'es.amazonaws.com'
98+
});
99+
```
100+
77101
## Importing existing domains
78102

79103
To import an existing domain into your CDK application, use the `Domain.fromDomainEndpoint` factory method.

0 commit comments

Comments
 (0)