-
Notifications
You must be signed in to change notification settings - Fork 15
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
Create tasks app to make tags consistent #388
Conversation
cmd/tasks/main.go
Outdated
|
||
func main() { | ||
actionPtr := flag.String("action", "", "Action to take. Accepted options: 'update-tags'") | ||
flag.Var(&servicesToTag, "service", "Specify AWS service whose instances should have tags updated. Accepted options: 'rds'") |
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.
It looks like this also handles ES & Redis now — I think the description needs an update
cmd/tasks/main.go
Outdated
|
||
// Load settings from environment | ||
if err := settings.LoadFromEnv(); err != nil { | ||
log.Fatalf("There was an error loading settings: %s", err) |
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.
Not necessary but one trick I thought I'd share: Write a run()
function that can return an error
and call run()
from main()
, so you can centralize top-level error handling. Example: https://github.com/cloud-gov/csb/blob/4328653379aa40e09e298c2e9015926e37a4e69b/docproxy/main.go#L208-L227
Changes proposed in this pull request:
Related to cloud-gov/opensearch-boshrelease#144
Currently, old instances (RDS, Elasticache, or Elasticsearch) created by the broker before consistent tagging was introduced may not have that tagging applied to them.
This PR creates a new app, managed in
cmd/tasks
, which will be used to run various one-off tasks against the broker and its instances.In particular, this PR introduces a task to update the tags for all instances to be consistent with what the broker now generates.
Things to check
INFO
and debugging statements are written withlog.debug
or similar, then they won't be written to the otput, which can prevent unintentional leaks of sensitive data.Security considerations
None. Tagging is already a feature of the broker, this script is just retroactively applying that tagging consistently to old instances. No new permissions or behaviors were added.