Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elasticsearch integration #114

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AffiTheCreator
Copy link

  • added Elasticsearch stack YAML file
  • updated tenant-onboarding.yaml to work with Elasticsearch
  • updated saas-boost-svc-onboarding.yaml to fit Elasticsearch permissions

closes #32


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

* updated tenant-onboarding.yaml to work with Elasticsearch
* updated saas-boost-svc-onboarding.yaml to fit Elasticsearch permissions
@AffiTheCreator
Copy link
Author

Due to the necessity of having an Elasticsearch cluster associated to my application running on SaaS boost, I have created a basic onboarding template to generate such a stack.

It's not ready for production nor to be joined to master, but after a talked with @4patelr and also since there is a lot to do I think it's a good starting point for the community to start contributing and make this feature ready for production.

Copy link
Contributor

@PoeppingT PoeppingT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @AffiTheCreator , thank you for your contribution and opening a pull request! I've just completed an initial review of the work you've done so far with some high level comments of things that can be improved.

Are you also working on integrating this Elasticsearch feature into the installer and admin UI? Unless I misunderstand the use case, it may make sense for different tenants to be able to be provisioned with different instance types, Elasticsearch cluster sizes, etc.

Lastly, I would suggest both that you make sure your fork is up to date with main so we confirm that the only changes in this PR are changes you intend to go into your single commit and that you run a fresh SaaS Boost Install with this Elasticsearch integration to help us understand the end-to-end user experience with this feature.

Thanks for your contribution and your attention! We look forward to working with you to get this contribution in.

Comment on lines +236 to +242
# # Elasticsearch policy
# - Effect: Allow
# Action:
# - es:DescribeElasticsearchDomain
# Resource:
# - !Sub arn:aws:es:${AWS::Region}:${AWS::AccountId}:domain/*/*

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these commented out lines need to be here?

Comment on lines -1203 to -1205
API_TRUST_ROLE: !Sub arn:aws:iam::${AWS::AccountId}:role/sb-private-api-trust-role-${Environment}-${AWS::Region}
API_GATEWAY_HOST: !Sub ${SaaSBoostPrivateApi}.execute-api.${AWS::Region}.amazonaws.com
API_GATEWAY_STAGE: !Ref PrivateApiStage
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These variables are used by the onboarding service to properly function. Have you tested a fresh SaaS Boost install with these changes?

are a-z (lowercase only), 0-9, and - (hyphen).
AllowedPattern: '[a-z][a-z0-9\\-]+'
ElasticsearchVersion:
Default: '6.2'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not choose the latest version?

Type: Number
Default: '10'
Conditions:
EnforceHTTPS_false: !Equals [ !Ref "EnforceHTTPS", "false" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could simplify this condition by just naming it ShouldEnforceHTTPS and checking that it's equal to true. Your results for checks against the condition just flip.

Comment on lines +902 to +904
# case specific - debug purpose
# - es:ESHttpPut
##############
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you describe in what cases this would be useful?

Properties:
GroupId: !Ref ESSecurityGroup
IpProtocol: tcp
# To review !!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify what you mean by this comment?

EnforceHTTPS: !Ref EnforceHTTPS
EBSOptions:
EBSEnabled: !Ref EBSEnabled
Iops: 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Iops under EBSOptions means "The number of I/O operations per second (IOPS) that the volume supports. This property applies only to the Provisioned IOPS (SSD) EBS volume type. reference" It's also not required: why do we explicitly set it to 0 here?

Comment on lines +147 to +151
- Effect: Allow
Principal:
AWS: '*'
Action: "es:*"
Resource: !Sub "arn:aws:es:${AWS::Region}:${AWS::AccountId}:domain/${ElasticsearchName}/*"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gives every AWS logged in user permissions to enact any Elasticsearch operation on this Elasticsearch domain. This must be restricted down to at the very least the account running this SaaS Boost installation by default. Developers using Elasticsearch as part of their SaaS Boost installation can change this to accept a wider set of incoming traffic if needed, but we shouldn't endorse that by default.

@@ -18,13 +18,16 @@ Parameters:
Environment:
Description: Environment (test, uat, prod, etc.)
Type: String
Default: oct12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes were removed by d0d0478. Is your fork up to date with main?

@@ -586,7 +742,13 @@ Resources:
- !Sub arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/saas-boost/${Environment}/DB_PORT
- !Sub arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/saas-boost/${Environment}/DB_HOST
- !Sub arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/saas-boost/${Environment}/DB_NAME
- !Sub arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/saas-boost/${Environment}/METRICS_STREAM
- !Sub arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/saas-boost/${Environment}METRICS_STREAM
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've removed the last / before METRICS_STREAM here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add elasticsearch support
2 participants