Cannot provison ElasticSearch nested stack #69
Replies: 7 comments 2 replies
-
The errors is happening because the execution role for the Lambda function that executes the tenant-onboarding.yaml does not have permissions for elasticsearch. Take a look at the saas-boost-svc-onboarding.yaml and the role on line 224 with: You need to add permissions to the role for es:DescribeElasticsearchDomain and other permissions like es:CreateElasticsearchDomain. Take a look at https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazonelasticsearchservice.html. For development, since the role is already existing in your account, you could go into the AWS IAM console --> Roles and edit the sb-dev-onboarding-svc-role-eu-west-1 to add the permissions and then try to onboard a tenant again. Once you have the permissions determined, modify the saas-boost-svc-onboarding.yaml and update your environment. Besides the onboarding-svc-role, you will need to add permissions to the onboarding-delete-tenant role in the same saas-boost-svc-onboarding.yaml to allowing delete of the ES resources. |
Beta Was this translation helpful? Give feedback.
-
@4patelr thanks for the reply :) So after reading the documentation I added this to the Policy that starts in line 243 # Elasticsearch onboarding policy
- Effect: Allow
Action:
- es:AddTags
- es:CreateElasticsearchDomain
- es:DescribeElasticsearchDomain
- es:CreateElasticsearchServiceRole
Resource:
- !Sub arn:aws:es:${AWS::Region}:${AWS::AccountId}:domain/$(Fn::GetAtt:[es.outputs.ESClusterName])/* Also added the above to onboarding-delete-tenant role in the same way as before: # Elasticsearch onboarding delete policy
- Effect: Allow
Action:
- es:DeleteElasticsearchDomain
- es:DeleteElasticsearchServiceRole
- es:DescribeElasticsearchDomain
- es:RemoveTags
Resource:
- !Sub arn:aws:es:${AWS::Region}:${AWS::AccountId}:domain/$(Fn::GetAtt:[es.outputs.ESClusterName])/* In my tenant-onboarding-es.yaml I already defined my AccessPolicies, althought it's for dev purpose: AccessPolicies:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
AWS: '*'
Action: "es:*"
Resource: !Sub "arn:aws:es:${AWS::Region}:${AWS::AccountId}:domain/${ElasticsearchName}/*"
Tags:
- Key: Tenant
Value: !Ref TenantId
I have also updated my repository with the new changes |
Beta Was this translation helpful? Give feedback.
-
If you are provisioning a ES cluster per tenant then you would not want to use the outputs from the es stack in the following as that won't be available when the Lamba execution role is created.
Instead, you could use something like this:
|
Beta Was this translation helpful? Give feedback.
-
After modifying the scripts, I keep getting the same error:
|
Beta Was this translation helpful? Give feedback.
-
Did you run the install.sh to update SaaS Boost environment after adding the permissions to the yaml file? |
Beta Was this translation helpful? Give feedback.
-
I uploaded the files directly to the s3 bucket of SaaS boost - so I don't need to run install.sh (right?) |
Beta Was this translation helpful? Give feedback.
-
In the case where you modify any of the saas-boost-* yaml files, you have to run the update of the CloudFormation stack and you can do this either by going into the CloudFormation console and performing an "Update" or you can run install.sh and choose to upgrade your existing environment. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to integrate Amazon Elasticsearch with SaaS boost, I have created a yaml file similar to the rds and efs extensions, i have also modified tenant-onboarding to fit the new extension modification.
Reproduction Steps
Project: https://github.com/AffiTheCreator/aws-saas-boost/tree/elasticsearch
What did you expect to happen?
A tenant to be provision with an Elasticsearch node
What actually happened?
The stack failed to create with status reason:
Environment
Other
This is 🐛 Bug Report
Beta Was this translation helpful? Give feedback.
All reactions