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

Init doesn't ask for Terraform #472

Open
OliverCole opened this Issue Jul 3, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@OliverCole
Copy link

OliverCole commented Jul 3, 2016

  • Operating system: Win 10
  • Apex Version: 0.10.2

The opposite of bug #343 - I never see the "Would you like to manage infrastructure with Terraform?" message.

C:\Users\Oliver\Sync\[master]> apex init


             _    ____  _______  __
            / \  |  _ \| ____\ \/ /
           / _ \ | |_) |  _|  \  /
          / ___ \|  __/| |___ /  \
         /_/   \_\_|   |_____/_/\_\



  Enter the name of your project. It should be machine-friendly, as this
  is used to prefix your functions in Lambda.

    Project name: bug

  Enter an optional description of your project.

    Project description: bug

  [+] creating IAM bug_lambda_function role
  [+] creating IAM bug_lambda_logs policy
  [+] attaching policy to lambda_function role.
  [+] creating ./project.json
  [+] creating ./functions

  Setup complete, deploy those functions!

    $ apex deploy

@tj

This comment has been minimized.

Copy link
Member

tj commented Jul 3, 2016

It got refactored away, apex sets up the initial role now, so the terraform directory would be basically just an empty main.tf in ./infrastructure/{stage,prod}/main.tf, but probably still best to have something!

@OliverCole

This comment has been minimized.

Copy link
Author

OliverCole commented Jul 3, 2016

I'm not sure I fully get what apex infra is supposed to achieve. Can I basically use it to pass the lambda ARN into a terraform variable?

You say main.tf would be empty because the role is already created, but what about the actual lambda function? Surely there would be a aws_lambda_function resource in the generated file?

As a side note, I was a little alarmed that apex init hits IAM and creates the role and policy. Shouldn't that wait until apex deploy or perhaps apex infra apply ?

@tj

This comment has been minimized.

Copy link
Member

tj commented Jul 3, 2016

It could potentially be deferred but that would just slow every deploy down unless local state was used. apex infra is effectively just a wrapper around the terraform command to pass some variables down, and make multi-environment use easier.

@OliverCole

This comment has been minimized.

Copy link
Author

OliverCole commented Jul 5, 2016

Ok - is there some documentation on what gets passed down?

@tj

This comment has been minimized.

Copy link
Member

tj commented Jul 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment