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

Add Custom::App CloudFormation resource. #819

Closed
wants to merge 2 commits into from
Closed

Conversation

ejholmes
Copy link
Contributor

@ejholmes ejholmes commented May 5, 2016

Closes #810

This adds a Custom::App resource, so you can provision Empire applications, and set environment variables from CloudFormation stacks. This allows you to provision your entire infrastructure, including Empire apps, and link it all together.

Not quite ready, because I think there's some UX things to address first, but I'm pretty excited about what this enables.

TODO

  • Environment variables set by CloudFormation probably shouldn't be editable (or visible) from emp set.
  • Docs
  • Can we use Custom::Empire::App?


func (p *AppsProvisioner) Provision(req Request) (id string, data interface{}, err error) {
ctx := context.Background()
user := &empire.User{Name: "cloudformation"}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool thing is you'll still get even notifications when CloudFormation sets environment variables.

@nzoschke
Copy link

nzoschke commented May 5, 2016

This is really neat :)

@ejholmes
Copy link
Contributor Author

ejholmes commented May 5, 2016

Thinking about this a bit, I think you should be able to control whether an environment variable is secret (hidden from emp env) and whether an environment variable is locked by the context that set it (e.g. stack id).

There's certain things that we'd want to make both locked and secret (like DATABASE_URL) and certain things that we might want to just set as sensible defaults when a new environment is brought up.

@ejholmes ejholmes changed the title Add Custom:App CloudFormation resource. Add Custom::App CloudFormation resource. May 5, 2016
ports: lb.NewDBPortAllocator(db),
ports: lb.NewDBPortAllocator(empire.DB.DB.DB()),
},
"Custom::App": &AppsProvisioner{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should check if it's possible to use Custom::Empire::App here. Not sure.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. I tried it but didn't work. Maybe just make this Custom::EmpireApp.

_, err := p.empire.Set(ctx, empire.SetOpts{
User: user,
App: app,
Vars: vars,
Copy link
Contributor

Choose a reason for hiding this comment

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

would be cool to pass a message here describing which CF event set the variables, ie. update or create

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call. I'll update this with messages.

@mwildehahn
Copy link
Contributor

i can't get over how cool this is going to be. 95% of the variables set within my empire apps are from cloudformation via stacker. being able to define everything within cloudformation is going to be life changing.

👍 👍 💯

@mwildehahn
Copy link
Contributor

#855 should be used instead

@ejholmes
Copy link
Contributor Author

ejholmes commented Jun 2, 2016

Closing in favor of #855

@ejholmes ejholmes closed this Jun 2, 2016
@ejholmes ejholmes deleted the app-resource branch March 1, 2017 04:41
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.

3 participants