-
Notifications
You must be signed in to change notification settings - Fork 30
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
Add option to take a snapshot of a managed service source cluster #1028
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -187,6 +187,33 @@ export function createDefaultECSTaskRole(scope: Construct, serviceName: string): | |
return serviceTaskRole | ||
} | ||
|
||
export function createSnapshotOnAOSRole(scope: Construct, artifactS3Arn: string, migrationConsoleTaskRoleArn: string, | ||
region: string, stage: string, defaultDeployId: string): Role { | ||
const snapshotRole = new Role(scope, `SnapshotRole`, { | ||
assumedBy: new ServicePrincipal('es.amazonaws.com'), // Note that snapshots are not currently possible on AOSS | ||
description: 'Role that grants OpenSearch Service permissions to access S3 to create snapshots', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a deterministic name to avoid suffix? |
||
roleName: `OSMigrations-${stage}-${region}-${defaultDeployId}-SnapshotRole` | ||
}); | ||
snapshotRole.addToPolicy(new PolicyStatement({ | ||
effect: Effect.ALLOW, | ||
actions: ['s3:ListBucket'], | ||
resources: [artifactS3Arn], | ||
})); | ||
|
||
snapshotRole.addToPolicy(new PolicyStatement({ | ||
effect: Effect.ALLOW, | ||
actions: ['s3:GetObject', 's3:PutObject', 's3:DeleteObject'], | ||
resources: [`${artifactS3Arn}/*`], | ||
})); | ||
|
||
// The Migration Console Role needs to be able to pass the snapshot role | ||
const requestingRole = Role.fromRoleArn(scope, 'RequestingRole', migrationConsoleTaskRoleArn); | ||
snapshotRole.grantPassRole(requestingRole); | ||
|
||
return snapshotRole | ||
} | ||
|
||
|
||
export function validateFargateCpuArch(cpuArch?: string): CpuArchitecture { | ||
const desiredArch = cpuArch ?? process.arch | ||
const desiredArchUpper = desiredArch.toUpperCase() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,11 +54,12 @@ The optional component is: | |
|
||
### Reindex from Snapshot (RFS) Service Options | ||
|
||
| Name | Type | Example | Description | | ||
| --------------------------------- | ------- | -------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| reindexFromSnapshotServiceEnabled | boolean | true | Create resources for deploying and configuring the RFS ECS service | | ||
| reindexFromSnapshotExtraArgs | string | "--target-aws-region us-east-1 --target-aws-service-signing-name es" | Extra arguments to provide to the Document Migration command with space separation. See [RFS Arguments](../../../DocumentsFromSnapshotMigration/README.md#Arguments). [^1] | | ||
| sourceClusterEndpoint | string | `"https://source-cluster.elb.us-east-1.endpoint.com"` | The endpoint for the source cluster from which RFS will take a snapshot | | ||
| Name | Type | Example | Description | | ||
| ----------------------------------- | ------- | -------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| reindexFromSnapshotServiceEnabled | boolean | true | Create resources for deploying and configuring the RFS ECS service | | ||
| reindexFromSnapshotExtraArgs | string | "--target-aws-region us-east-1 --target-aws-service-signing-name es" | Extra arguments to provide to the Document Migration command with space separation. See [RFS Arguments](../../../DocumentsFromSnapshotMigration/README.md#Arguments). [^1] | | ||
| sourceClusterEndpoint | string | `"https://source-cluster.elb.us-east-1.endpoint.com"` | The endpoint for the source cluster from which RFS will take a snapshot | | ||
| managedServiceSourceSnapshotEnabled | boolean | true | Create the necessary roles and trust relationships to take a snapshot of a managed service source cluster. This is only compatible with SigV4 auth. | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to make this a top level argument instead of within source cluster? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I went back and forth on this--it's a combo of RFS-related and source-cluster related, so it didn't fit perfectly anywhere. Would you prefer in the source object? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm good with this for now |
||
|
||
### VPC Options | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, this could have really tripped up a customer