Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Fixed some AWS Settings. #8094

Merged
merged 1 commit into from
Jun 20, 2023
Merged

Fixed some AWS Settings. #8094

merged 1 commit into from
Jun 20, 2023

Conversation

barankyle
Copy link
Member

@barankyle barankyle commented Jun 16, 2023

Summary

S3/Cloudfront keys were put in config.aws.keys, which did not reflect what those keys did. Moved them to config.aws.s3, where it is more obvious what they have access to.

EKS/ECR keys were not in the AWS config/settings at all. Added new config child 'eks' to store them. Also, these keys were named as environment variables as 'AWS_ACCESS_KEY'/'AWS_SECRET', which did not indicate what they had access to. Renamed these references to 'EKS_AWS_ACCESS_KEY'/ 'EKS_AWS_SECRET'. Updated aws-setting schema to reflect this change. Added script to convert existing databases to the new schema/placement.

References

closes #insert number here

Checklist

  • If this PR is still a WIP, convert to a draft
  • When this PR is ready, mark it as "Ready for review"
  • ensure all checks pass
  • Changes have been manually QA'd
  • Changes reviewed by at least 2 approved reviewer

QA Steps

List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.

endpoint: process.env.STORAGE_S3_ENDPOINT,
staticResourceBucket: process.env.STORAGE_S3_STATIC_RESOURCE_BUCKET,
region: process.env.STORAGE_S3_REGION,
avatarDir: process.env.STORAGE_S3_AVATAR_DIRECTORY,
s3DevMode: process.env.STORAGE_S3_DEV_MODE
}),
eks: JSON.stringify({
Copy link
Member

@hanzlamateen hanzlamateen Jun 16, 2023

Choose a reason for hiding this comment

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

This will work for dev-reinit and for prepare-database when there is no existing record. But for scenarios where there is already an existing data and you used prepare-database then you will need to add this data to the column, else it will be empty.

You can have a look of packages/server-core/src/setting/client-setting/client-setting.seed.ts and see around line 87.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added a migration which will perform this conversion.

@barankyle barankyle force-pushed the aws-config-refactor branch 5 times, most recently from d15d8f0 to 6472604 Compare June 17, 2023 01:19
@barankyle barankyle marked this pull request as ready for review June 17, 2023 01:20
@barankyle barankyle linked an issue Jun 19, 2023 that may be closed by this pull request
S3/Cloudfront keys were put in config.aws.keys, which did not reflect what those keys did.
Moved them to config.aws.s3, where it is more obvious what they have access to.

EKS/ECR keys were not in the AWS config/settings at all. Added new config child 'eks' to store
them. Also, these keys were named as environment variables as 'AWS_ACCESS_KEY'/'AWS_SECRET',
which did not indicate what they had access to. Renamed these references to 'EKS_AWS_ACCESS_KEY'/
'EKS_AWS_SECRET'. Updated aws-setting schema to reflect this change. Added migration to add this
column and update s3 and eks columns with this changed schema and values.

Made custom dbToSchema resolvers non-async. They were returning promises instead of values, which
were not being merged properly with the base settings.
@barankyle barankyle added this pull request to the merge queue Jun 20, 2023
Merged via the queue into dev with commit bdd538a Jun 20, 2023
@barankyle barankyle deleted the aws-config-refactor branch June 20, 2023 19:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor AWS config to be clearer
2 participants