File tree Expand file tree Collapse file tree 9 files changed +25
-49
lines changed
Expand file tree Collapse file tree 9 files changed +25
-49
lines changed Original file line number Diff line number Diff line change 11# Container Linux AMI Module
22
33This [ Terraform] [ ] [ module] [ ] supports ` latest ` versions for [ Container Linux] [ container-linux ] release channels and returns an appropriate [ AMI] [ ] .
4+ It uses [ implicit provider inheritance] [ implicit-provider-inheritance ] to access the [ AWS provider] [ AWS-provider ] .
45
56## Example
67
7- From the module directory:
8+ Set up a ` main.tf ` with:
9+
10+ ``` hcl
11+ provider "aws" {
12+ region = "us-east-1"
13+ }
14+
15+ module "ami" {
16+ source = "github.com/openshift/installer//modules/aws/ami"
17+ }
18+
19+ output "ami" {
20+ value = "${module.ami.id}"
21+ }
22+ ```
23+
24+ You can set ` release_channel ` and ` release_version ` if you need a specific Container Linux install.
25+
26+ Then run:
827
928``` console
1029$ terraform init
11- $ terraform apply --var region=us-east-1
12- $ terraform output id
13- ami-ab6963d4
14- $ terraform apply --var region=us-east-1 --var release_channel=alpha
15- $ terraform output id
16- ami-985953e7
17- $ terraform apply --var region=us-east-2 --var release_channel=alpha --var release_version=1814.0.0
18- $ terraform output id
19- ami-c25f66a7
30+ $ terraform apply
31+ $ terraform output ami
32+ ami-00cc4337762ba4a52
2033```
2134
22- When you're done, clean up by removing the ` .terraform ` directory created by ` init ` and the ` terraform.tfstate* ` files created by ` apply ` .
23-
2435[ AMI ] : https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html
36+ [ AWS-provider ] : https://www.terraform.io/docs/providers/aws/
2537[ container-linux ] : https://coreos.com/os/docs/latest/
38+ [ implicit-provider-inheritance ] : https://www.terraform.io/docs/modules/usage.html#implicit-provider-inheritance
2639[ module ] : https://www.terraform.io/docs/modules/
2740[ Terraform ] : https://www.terraform.io/
Original file line number Diff line number Diff line change 1- provider "aws" {
2- region = " ${ var . region } "
3- version = " 1.8.0"
4- }
5-
61locals {
72 ami_owner = " 595879546273"
83 arn = " aws"
Original file line number Diff line number Diff line change 1- variable "region" {
2- type = " string"
3-
4- description = << EOF
5- This is the AWS region.
6- It is passed through to the Terraform aws provider: https://www.terraform.io/docs/providers/aws/#region
7- EOF
8- }
9-
101variable "release_channel" {
112 type = " string"
123 default = " stable"
Original file line number Diff line number Diff line change 55module "ami" {
66 source = " ../ami"
77
8- region = " ${ var . region } "
98 release_channel = " ${ var . container_linux_channel } "
109 release_version = " ${ var . container_linux_version } "
1110}
Original file line number Diff line number Diff line change @@ -80,15 +80,6 @@ variable "elb_console_id" {
8080 type = " string"
8181}
8282
83- variable "region" {
84- type = " string"
85-
86- description = << EOF
87- This is the AWS region.
88- It is passed through to the Terraform aws provider: https://www.terraform.io/docs/providers/aws/#region
89- EOF
90- }
91-
9283variable "root_volume_iops" {
9384 type = " string"
9485 default = " 100"
Original file line number Diff line number Diff line change 55module "ami" {
66 source = " ../ami"
77
8- region = " ${ var . region } "
98 release_channel = " ${ var . container_linux_channel } "
109 release_version = " ${ var . container_linux_version } "
1110}
Original file line number Diff line number Diff line change @@ -48,15 +48,6 @@ variable "extra_tags" {
4848 default = {}
4949}
5050
51- variable "region" {
52- type = " string"
53-
54- description = << EOF
55- This is the AWS region.
56- It is passed through to the Terraform aws provider: https://www.terraform.io/docs/providers/aws/#region
57- EOF
58- }
59-
6051variable "root_volume_type" {
6152 type = " string"
6253 description = " The type of volume for the root block device."
Original file line number Diff line number Diff line change @@ -42,7 +42,6 @@ data "ignition_config" "bootstrap_redirect" {
4242module "ami" {
4343 source = " ../../../modules/aws/ami"
4444
45- region = " ${ var . tectonic_aws_region } "
4645 release_channel = " ${ var . tectonic_container_linux_channel } "
4746 release_version = " ${ var . tectonic_container_linux_version } "
4847}
Original file line number Diff line number Diff line change @@ -42,7 +42,6 @@ module "masters" {
4242 master_sg_ids = " ${ concat (var. tectonic_aws_master_extra_sg_ids , list (module. vpc . master_sg_id ))} "
4343 private_endpoints = " ${ local . private_endpoints } "
4444 public_endpoints = " ${ local . public_endpoints } "
45- region = " ${ var . tectonic_aws_region } "
4645 root_volume_iops = " ${ var . tectonic_aws_master_root_volume_iops } "
4746 root_volume_size = " ${ var . tectonic_aws_master_root_volume_size } "
4847 root_volume_type = " ${ var . tectonic_aws_master_root_volume_type } "
@@ -62,7 +61,6 @@ module "workers" {
6261 extra_tags = " ${ var . tectonic_aws_extra_tags } "
6362 instance_count = " ${ var . tectonic_worker_count } "
6463 load_balancers = " ${ var . tectonic_aws_worker_load_balancers } "
65- region = " ${ var . tectonic_aws_region } "
6664 root_volume_iops = " ${ var . tectonic_aws_worker_root_volume_iops } "
6765 root_volume_size = " ${ var . tectonic_aws_worker_root_volume_size } "
6866 root_volume_type = " ${ var . tectonic_aws_worker_root_volume_type } "
You can’t perform that action at this time.
0 commit comments