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 1
1
# Container Linux AMI Module
2
2
3
3
This [ 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 ] .
4
5
5
6
## Example
6
7
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:
8
27
9
28
``` console
10
29
$ 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
20
33
```
21
34
22
- When you're done, clean up by removing the ` .terraform ` directory created by ` init ` and the ` terraform.tfstate* ` files created by ` apply ` .
23
-
24
35
[ AMI ] : https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html
36
+ [ AWS-provider ] : https://www.terraform.io/docs/providers/aws/
25
37
[ container-linux ] : https://coreos.com/os/docs/latest/
38
+ [ implicit-provider-inheritance ] : https://www.terraform.io/docs/modules/usage.html#implicit-provider-inheritance
26
39
[ module ] : https://www.terraform.io/docs/modules/
27
40
[ 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
-
6
1
locals {
7
2
ami_owner = " 595879546273"
8
3
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
-
10
1
variable "release_channel" {
11
2
type = " string"
12
3
default = " stable"
Original file line number Diff line number Diff line change 5
5
module "ami" {
6
6
source = " ../ami"
7
7
8
- region = " ${ var . region } "
9
8
release_channel = " ${ var . container_linux_channel } "
10
9
release_version = " ${ var . container_linux_version } "
11
10
}
Original file line number Diff line number Diff line change @@ -80,15 +80,6 @@ variable "elb_console_id" {
80
80
type = " string"
81
81
}
82
82
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
-
92
83
variable "root_volume_iops" {
93
84
type = " string"
94
85
default = " 100"
Original file line number Diff line number Diff line change 5
5
module "ami" {
6
6
source = " ../ami"
7
7
8
- region = " ${ var . region } "
9
8
release_channel = " ${ var . container_linux_channel } "
10
9
release_version = " ${ var . container_linux_version } "
11
10
}
Original file line number Diff line number Diff line change @@ -48,15 +48,6 @@ variable "extra_tags" {
48
48
default = {}
49
49
}
50
50
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
-
60
51
variable "root_volume_type" {
61
52
type = " string"
62
53
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" {
42
42
module "ami" {
43
43
source = " ../../../modules/aws/ami"
44
44
45
- region = " ${ var . tectonic_aws_region } "
46
45
release_channel = " ${ var . tectonic_container_linux_channel } "
47
46
release_version = " ${ var . tectonic_container_linux_version } "
48
47
}
Original file line number Diff line number Diff line change @@ -42,7 +42,6 @@ module "masters" {
42
42
master_sg_ids = " ${ concat (var. tectonic_aws_master_extra_sg_ids , list (module. vpc . master_sg_id ))} "
43
43
private_endpoints = " ${ local . private_endpoints } "
44
44
public_endpoints = " ${ local . public_endpoints } "
45
- region = " ${ var . tectonic_aws_region } "
46
45
root_volume_iops = " ${ var . tectonic_aws_master_root_volume_iops } "
47
46
root_volume_size = " ${ var . tectonic_aws_master_root_volume_size } "
48
47
root_volume_type = " ${ var . tectonic_aws_master_root_volume_type } "
@@ -62,7 +61,6 @@ module "workers" {
62
61
extra_tags = " ${ var . tectonic_aws_extra_tags } "
63
62
instance_count = " ${ var . tectonic_worker_count } "
64
63
load_balancers = " ${ var . tectonic_aws_worker_load_balancers } "
65
- region = " ${ var . tectonic_aws_region } "
66
64
root_volume_iops = " ${ var . tectonic_aws_worker_root_volume_iops } "
67
65
root_volume_size = " ${ var . tectonic_aws_worker_root_volume_size } "
68
66
root_volume_type = " ${ var . tectonic_aws_worker_root_volume_type } "
You can’t perform that action at this time.
0 commit comments