forked from openshift/installer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request openshift#213 from wking/implicit-provider-inherit…
…ance modules/aws/ami: Use implicit provider inheritance
- Loading branch information
Showing
9 changed files
with
25 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,40 @@ | ||
# Container Linux AMI Module | ||
|
||
This [Terraform][] [module][] supports `latest` versions for [Container Linux][container-linux] release channels and returns an appropriate [AMI][]. | ||
It uses [implicit provider inheritance][implicit-provider-inheritance] to access the [AWS provider][AWS-provider]. | ||
|
||
## Example | ||
|
||
From the module directory: | ||
Set up a `main.tf` with: | ||
|
||
```hcl | ||
provider "aws" { | ||
region = "us-east-1" | ||
} | ||
module "ami" { | ||
source = "github.com/openshift/installer//modules/aws/ami" | ||
} | ||
output "ami" { | ||
value = "${module.ami.id}" | ||
} | ||
``` | ||
|
||
You can set `release_channel` and `release_version` if you need a specific Container Linux install. | ||
|
||
Then run: | ||
|
||
```console | ||
$ terraform init | ||
$ terraform apply --var region=us-east-1 | ||
$ terraform output id | ||
ami-ab6963d4 | ||
$ terraform apply --var region=us-east-1 --var release_channel=alpha | ||
$ terraform output id | ||
ami-985953e7 | ||
$ terraform apply --var region=us-east-2 --var release_channel=alpha --var release_version=1814.0.0 | ||
$ terraform output id | ||
ami-c25f66a7 | ||
$ terraform apply | ||
$ terraform output ami | ||
ami-00cc4337762ba4a52 | ||
``` | ||
|
||
When you're done, clean up by removing the `.terraform` directory created by `init` and the `terraform.tfstate*` files created by `apply`. | ||
|
||
[AMI]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html | ||
[AWS-provider]: https://www.terraform.io/docs/providers/aws/ | ||
[container-linux]: https://coreos.com/os/docs/latest/ | ||
[implicit-provider-inheritance]: https://www.terraform.io/docs/modules/usage.html#implicit-provider-inheritance | ||
[module]: https://www.terraform.io/docs/modules/ | ||
[Terraform]: https://www.terraform.io/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
provider "aws" { | ||
region = "${var.region}" | ||
version = "1.8.0" | ||
} | ||
|
||
locals { | ||
ami_owner = "595879546273" | ||
arn = "aws" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters