Skip to content

Update terraform/aws to support terraform version 0.7.x - #172

Merged
enxebre merged 4 commits into
Capgemini:masterfrom
tamsky:terraform-0.7.x
Dec 9, 2016
Merged

Update terraform/aws to support terraform version 0.7.x#172
enxebre merged 4 commits into
Capgemini:masterfrom
tamsky:terraform-0.7.x

Conversation

@tamsky

@tamsky tamsky commented Dec 1, 2016

Copy link
Copy Markdown
Contributor

supersedes #171

/cc @enxebre

* includes changes from Capgemini#86
* Fix nested quotes for terraform 0.7.x
* Use template_file as data resource for terraform 0.7.x
* Convert etcd_discovery_url to null_resource

  In Terraform 0.7.x, template file data sources do not support the
  'provisioner' parameter. So instead, we must now use a null_resource to
  get the discovery URL.

  And, unfortunately, depending on a null_resource does not mean that you
  can read the file before it exists.

* separate out vpc_public_cidrs_list and move it next to dependent list of AZs
* aws_instance: fix subnet_id
* convert security_groups -> vpc_security_group_ids
* tag aws_vpc with org Name
* add empty etcd_discovery_url.txt
### Provision the cluster infrastructure

```
cd /tmp/kubeform/terraform/aws/public-cloud

@enxebre enxebre Dec 2, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This step terraform apply -target=null_resource.etcd_discovery_url is not necessary, we can remove this. We need to add the new terraform version requirement in this file.
For squashing I usually use git rebase -i you can also use git merge --squash or something like https://github.com/tj/git-extras/blob/master/Commands.md#git-squash, or just recreate your local branch as you must have done here, then you need to git push --force against your branch when you are sure you want to override it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since most blocks already do, I thought it would be an improvement to always start each shell block with a cd. Removed.

Requirement at the top updated. I picked 0.7.11 since that's what I tested with.

@tamsky

tamsky commented Dec 2, 2016

Copy link
Copy Markdown
Contributor Author

@enxebre I've granted permission for you to commit to this branch in my repo, if you'd prefer to make any further edits.

Also suggest checking out github's "Squash & Merge" option if you'd like to keep the commit history clean.

@enxebre

enxebre commented Dec 2, 2016

Copy link
Copy Markdown
Contributor

Hey @tamsky thanks for the suggestion! I'm sorry if my last comment here bea1781 was confuse, the bit that we should remove is terraform apply -target=null_resource.etcd_discovery_url
We don't need that step.
The file is already in the repo, so "${file(var.etcd_discovery_url_file)}" won't complain when creating the resource graph.
Then the null resource will populate the file with the right value right before creating the new vm at execution time.
Don't you agree?
After that we can merge!

@tamsky

tamsky commented Dec 3, 2016

Copy link
Copy Markdown
Contributor Author

Removed manual step.

Don't you agree?

I agree!
Just tested now.
LGTM.

Squash & merge away.

Comment thread terraform/aws/private-cloud/main.tf Outdated
}

# This will regenerate the discovery URL if the cluster size changes
triggers {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

do we want to remove this from the private-cloud tree as well?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yes please, lets keep both aligned for consistency.

@tamsky

tamsky commented Dec 5, 2016

Copy link
Copy Markdown
Contributor Author

I have updated the private-cloud tree with the changes I was able to identify.

terraform plan now runs cleanly.

Also found this syntax/typo that probably should have been caught before by any test that ran terraform plan.

Given that there is no README for this directory, I'm not testing terraform apply

@enxebre please test private-cloud if your org is still using that directory.

Thanks!

@tamsky

tamsky commented Dec 5, 2016

Copy link
Copy Markdown
Contributor Author

@enxebre also, what do you want to do regarding the outputs that exist in private-cloud but are missing from public-cloud:

https://github.com/tamsky/kubeform/blob/terraform-0.7.x/terraform/aws/private-cloud/main.tf#L80-L95

@enxebre

enxebre commented Dec 9, 2016

Copy link
Copy Markdown
Contributor

@tamsky this is good to go. thanks for contributing!

@enxebre
enxebre merged commit 07a4d6b into Capgemini:master Dec 9, 2016
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