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

Set up stage-specific config #12

Merged
merged 1 commit into from
Feb 6, 2024
Merged

Set up stage-specific config #12

merged 1 commit into from
Feb 6, 2024

Conversation

kelvin-chappell
Copy link
Member

@kelvin-chappell kelvin-chappell commented Feb 5, 2024

This is a change to use the recommended simple configuration library to give us stage-specific config by reading the stage tag on the host EC2 instance.
I've largely followed the examples in the simple-configuration readme.

Tested on Code.

@kelvin-chappell kelvin-chappell marked this pull request as ready for review February 5, 2024 11:50
@kelvin-chappell kelvin-chappell requested a review from a team as a code owner February 5, 2024 11:50
"net.logstash.logback" % "logstash-logback-encoder" % "7.3",
("com.gu" %% "simple-configuration-ssm" % "1.6.4").cross(CrossVersion.for3Use2_13),
Copy link
Member Author

Choose a reason for hiding this comment

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

There's no Scala 3 version of the library yet

@@ -34,7 +34,7 @@ export class Gatehouse extends GuStack {
userData: {
distributable: {
fileName: `${ec2App}.deb`,
executionStatement: `dpkg -i /${ec2App}/${ec2App}.deb && echo "stage=${this.stage}" | sudo tee "/etc/gatehouse/stage.conf" > /dev/null`,
executionStatement: `dpkg -i /${ec2App}/${ec2App}.deb`,
Copy link
Member Author

Choose a reason for hiding this comment

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

Because we're getting the stage from EC2 tags, we no longer need to write a file with the stage value in it.

super.configuration
else
Configuration("play.http.secret.key" -> secretKey).withFallback(super.configuration)

Copy link
Contributor

Choose a reason for hiding this comment

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

are you planning to to use play secret rotation ? I think it's still the recommendation

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes I started looking at that. Thanks for the reminder

Copy link
Contributor

@pvighi pvighi left a comment

Choose a reason for hiding this comment

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

looks good to me

@kelvin-chappell kelvin-chappell merged commit 41bd21a into main Feb 6, 2024
1 check passed
@kelvin-chappell kelvin-chappell deleted the kc/config branch February 6, 2024 12:59
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