mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-10 00:58:17 +03:00
M #-: OneProvision: search AWS ami in Terraform (#1840)
This commit is contained in:
parent
eb2790b368
commit
3d0665e457
@ -10,10 +10,9 @@ connection:
|
||||
|
||||
inputs:
|
||||
- name: 'aws_ami_image'
|
||||
type: 'list'
|
||||
default: 'ami-0498a49a15494604f'
|
||||
options:
|
||||
- 'ami-0498a49a15494604f'
|
||||
type: 'text'
|
||||
default: 'default'
|
||||
description: 'AWS AMI image (default = Ubuntu Focal)'
|
||||
- name: 'aws_instance_type'
|
||||
type: 'list'
|
||||
default: 'c5.metal'
|
||||
|
@ -10,10 +10,9 @@ connection:
|
||||
|
||||
inputs:
|
||||
- name: 'aws_ami_image'
|
||||
type: 'list'
|
||||
default: 'ami-01d912b5940be07a5'
|
||||
options:
|
||||
- 'ami-01d912b5940be07a5'
|
||||
type: 'text'
|
||||
default: 'default'
|
||||
description: 'AWS AMI image (default = Ubuntu Focal)'
|
||||
- name: 'aws_instance_type'
|
||||
type: 'list'
|
||||
default: 'c5.metal'
|
||||
|
@ -10,10 +10,9 @@ connection:
|
||||
|
||||
inputs:
|
||||
- name: 'aws_ami_image'
|
||||
type: 'list'
|
||||
default: 'ami-01896de1f162f0ab7'
|
||||
options:
|
||||
- 'ami-01896de1f162f0ab7'
|
||||
type: 'text'
|
||||
default: 'default'
|
||||
description: 'AWS AMI image (default = Ubuntu Focal)'
|
||||
- name: 'aws_instance_type'
|
||||
type: 'list'
|
||||
default: 'c5.metal'
|
||||
|
@ -10,10 +10,9 @@ connection:
|
||||
|
||||
inputs:
|
||||
- name: 'aws_ami_image'
|
||||
type: 'list'
|
||||
default: 'ami-0189702ff9c0b592f'
|
||||
options:
|
||||
- 'ami-0189702ff9c0b592f'
|
||||
type: 'text'
|
||||
default: 'default'
|
||||
description: 'AWS AMI image (default = Ubuntu Focal)'
|
||||
- name: 'aws_instance_type'
|
||||
type: 'list'
|
||||
default: 'c5.metal'
|
||||
|
@ -34,6 +34,7 @@ inputs:
|
||||
- name: 'aws_ami_image'
|
||||
type: text
|
||||
description: 'AWS ami image used for host deployments'
|
||||
default: 'default'
|
||||
|
||||
- name: 'aws_instance_type'
|
||||
type: text
|
||||
|
@ -10,10 +10,9 @@ connection:
|
||||
|
||||
inputs:
|
||||
- name: 'aws_ami_image'
|
||||
type: 'list'
|
||||
default: 'ami-0498a49a15494604f'
|
||||
options:
|
||||
- 'ami-0498a49a15494604f'
|
||||
type: 'text'
|
||||
default: 'default'
|
||||
description: 'AWS AMI image (default = Ubuntu Focal)'
|
||||
- name: 'aws_instance_type'
|
||||
type: 'list'
|
||||
default: 't2.micro'
|
||||
|
@ -10,10 +10,9 @@ connection:
|
||||
|
||||
inputs:
|
||||
- name: 'aws_ami_image'
|
||||
type: 'list'
|
||||
default: 'ami-0b0e59a09e7f4059f'
|
||||
options:
|
||||
- 'ami-0b0e59a09e7f4059f'
|
||||
type: 'text'
|
||||
default: 'default'
|
||||
description: 'AWS AMI image (default = Ubuntu Focal)'
|
||||
- name: 'aws_instance_type'
|
||||
type: 'list'
|
||||
default: 't2.micro'
|
||||
|
@ -10,10 +10,9 @@ connection:
|
||||
|
||||
inputs:
|
||||
- name: 'aws_ami_image'
|
||||
type: 'list'
|
||||
default: 'ami-01896de1f162f0ab7'
|
||||
options:
|
||||
- 'ami-01896de1f162f0ab7'
|
||||
type: 'text'
|
||||
default: 'default'
|
||||
description: 'AWS AMI image (default = Ubuntu Focal)'
|
||||
- name: 'aws_instance_type'
|
||||
type: 'list'
|
||||
default: 't2.micro'
|
||||
|
@ -10,10 +10,9 @@ connection:
|
||||
|
||||
inputs:
|
||||
- name: 'aws_ami_image'
|
||||
type: 'list'
|
||||
default: 'ami-0189702ff9c0b592f'
|
||||
options:
|
||||
- 'ami-0189702ff9c0b592f'
|
||||
type: 'text'
|
||||
default: 'default'
|
||||
description: 'AWS AMI image (default = Ubuntu Focal)'
|
||||
- name: 'aws_instance_type'
|
||||
type: 'list'
|
||||
default: 't2.micro'
|
||||
|
@ -34,6 +34,7 @@ inputs:
|
||||
- name: 'aws_ami_image'
|
||||
type: text
|
||||
description: 'AWS ami image used for host deployments'
|
||||
default: 'default'
|
||||
|
||||
- name: 'aws_instance_type'
|
||||
type: text
|
||||
|
@ -1,5 +1,28 @@
|
||||
data "aws_ami" "ubuntu2004" {
|
||||
|
||||
most_recent = true
|
||||
|
||||
filter {
|
||||
name = "name"
|
||||
values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"]
|
||||
}
|
||||
|
||||
filter {
|
||||
name = "virtualization-type"
|
||||
values = ["hvm"]
|
||||
}
|
||||
|
||||
owners = ["099720109477"]
|
||||
}
|
||||
|
||||
resource "aws_instance" "device_<%= obj['ID'] %>" {
|
||||
|
||||
<% if provision['AMI'] == 'default' %>
|
||||
ami = data.aws_ami.ubuntu2004.id
|
||||
<% else %>
|
||||
ami = "<%= provision['AMI'] %>"
|
||||
<% end %>
|
||||
|
||||
instance_type = "<%= provision['INSTANCETYPE'] %>"
|
||||
availability_zone = local.my_zones[0]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user