-
Notifications
You must be signed in to change notification settings - Fork 479
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
Update CloudFormation template to create log group & stream on deploy #51962
Update CloudFormation template to create log group & stream on deploy #51962
Conversation
@@ -617,7 +617,7 @@ Resources: | |||
<%= component 'alarms'%> | |||
<% end -%> | |||
|
|||
|
|||
<%= component 'browser_event_logging'%> |
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.
Might be handy to rename this to logging
and then Infrastructure team will add other logging Resources to this component in the future that are currently configured manually, provisioned in the top level template, or in some standalone template.
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.
Done!
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.
This looks great! Sorry the stack/domain naming turned out to be a hassle.
…#51962) * Test adding browser event log groups and stream to template * Try prefixing with env name * Try out <domain> * try stack name as default on adhoc * Rename component to logging
…#51962) * Test adding browser event log groups and stream to template * Try prefixing with env name * Try out <domain> * try stack name as default on adhoc * Rename component to logging
Updates the main cloudformation template with a step to create a browser events Log Group and Log Stream for the given stack. Some implementation notes:
stack_name
if on an adhoc (which is the full "adhoc-my-adhoc-name") orenvironment
otherwise (which is "production", "test", etc). We can't just usestack_name
because on production, this returnsautoscale-prod
which isn't as clear and wouldn't satisfy the constraint of the log group name needing to be prefixed with the environment name.code.org
as theBaseDomainName
, which doesn't match what the Rails controller calculates as the base domain, which iscdn-code.org
. We could use the<%=domain>
value inside the template to getcdn-code.org
but this felt unnecessarily verbose given we were already prefixing the name with the environment.Links
https://codedotorg.atlassian.net/browse/SL-799
Testing story
Tested on an adhoc: https://adhoc-browser-events-template-test-studio.cdn-code.org/
Generated Log Group: https://us-east-1.console.aws.amazon.com/cloudwatch/home?region=us-east-1#logsV2:log-groups/log-group/adhoc-browser-events-template-test-browser-events
Generated Log Stream: https://us-east-1.console.aws.amazon.com/cloudwatch/home?region=us-east-1#logsV2:log-groups/log-group/adhoc-browser-events-template-test-browser-events/log-events/adhoc-browser-events-template-test