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

Capture the created role arn for snapshotting into the AWS yaml parameter and pass it through the command line #1133

Merged

Conversation

gregschohn
Copy link
Collaborator

Description

Specifying 'managedServiceSourceSnapshotEnabled' in the cdk.context.json will now not just create the role for making a snapshot to s3, but it will add it to the services yaml file and the console will thread that through to the command line for snapshot create so that users don't have to.

  • Category Enhancement

Issues Resolved

https://opensearch.atlassian.net/browse/MIGRATIONS-2001

Is this a backport? If so, please add backport PR # and/or commits #

Testing

Manual deployments w/ and without the cdk.context.json value and w/ and w/out the value in migration_services.yaml

Check List

  • New functionality includes testing
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.71%. Comparing base (b62778e) to head (00c715d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #1133   +/-   ##
=========================================
  Coverage     80.71%   80.71%           
  Complexity     2947     2947           
=========================================
  Files           399      399           
  Lines         14962    14962           
  Branches       1017     1017           
=========================================
  Hits          12077    12077           
  Misses         2274     2274           
  Partials        611      611           
Flag Coverage Δ
gradle-test 78.74% <ø> (ø)
python-test 89.93% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -23,6 +23,7 @@
'schema': {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ideally there would be two tests for this:

  • one on the python side (if role is in the services.yaml, it should be included in the call to the java snapshot tool, a la this test and the ones nearby)
  • and one on the CDK side, where we set the managedServiceSourceSnapshotEnabled and make sure the policy gets created / added to the YAML (kind of like this one.

The python test is a low lift with decent helpful value to effectively document how role should effect the rest of the system. The CDK test is a much higher lift that should have been done in my previous PR, but wasn't. And is potentially going to be replaced in the near-ish future.

So I'd really like the python test, the CDK test is optional.

@@ -23,6 +23,7 @@
'schema': {
'repo_uri': {'type': 'string', 'required': True},
'aws_region': {'type': 'string', 'required': True},
'role': {'type': 'string', 'required': False}
Copy link
Collaborator

Choose a reason for hiding this comment

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

createSnapshotOnAOSRole(this, artifactS3Arn, serviceTaskRole.roleArn,
this.region, props.stage, props.defaultDeployId)
.roleArn;
// HOW DO I GET THIS servicesYaml into the parameter AND get the service created?
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure what this question is -- what do you mean by "get the service created"?

@mikaylathompson mikaylathompson self-requested a review November 13, 2024 20:36
…eter and pass it through the command line

Signed-off-by: Greg Schohn <greg.schohn@gmail.com>
…vices yaml file.

Signed-off-by: Greg Schohn <greg.schohn@gmail.com>
Signed-off-by: Greg Schohn <greg.schohn@gmail.com>
@gregschohn gregschohn force-pushed the PassRoleParameterForS3Snapshots branch from aa76e48 to 00c715d Compare November 13, 2024 20:40
@gregschohn gregschohn merged commit 5514bc7 into opensearch-project:main Nov 13, 2024
16 checks passed
@gregschohn gregschohn deleted the PassRoleParameterForS3Snapshots branch November 13, 2024 23:06
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.

2 participants