From 9f63745dcfbd208c6c681fec8805f7b4a0793365 Mon Sep 17 00:00:00 2001 From: hilderic Date: Tue, 17 Mar 2020 16:42:33 +0100 Subject: [PATCH 1/7] yorc.nodes.aws.VPC --- .../resources/aws/resources/resources.yaml | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/main/resources/aws/resources/resources.yaml b/src/main/resources/aws/resources/resources.yaml index 6414df3..f46019b 100644 --- a/src/main/resources/aws/resources/resources.yaml +++ b/src/main/resources/aws/resources/resources.yaml @@ -104,6 +104,48 @@ node_types: required: false default: false + yorc.nodes.aws.VPC: + derived_from: tosca.nodes.Network + # See https://www.terraform.io/docs/providers/aws/r/vpc.html + properties: + instance_tenancy: + type: string + description: > + You can run instances in your VPC on single-tenant, dedicated hardware. + Select Dedicated to ensure that instances launched in this VPC are dedicated tenancy instances, regardless of the tenancy attribute specified at launch. + Select Default to ensure that instances launched in this VPC use the tenancy attribute specified at launch + default: default + constraints : + - valid_values: [default, dedicated] + enable_dns_support: + type: boolean + description: A boolean flag to enable/disable DNS support in the VPC. Defaults true. + default: true + required: false + enable_dns_hostnames: + type: boolean + default: false + description : A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false. + required: false + enable_classiclink: + type: boolean + default: false + description: A boolean flag to enable/disable ClassicLink for the VPC. Only valid in regions and accounts that support EC2 Classic. + required: false + enable_classiclink_dns_support: + type: boolean + required: false + description: A boolean flag to enable/disable ClassicLink DNS Support for the VPC. Only valid in regions and accounts that support EC2 Classic + assign_generated_ipv6_cidr_block: + type: boolean + required: false + description: Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block. + tags: + type: map + description: A mapping of tags to assign to the resource. + required: false + entry_schema: + type: string ############################################## # Abstract resources used for auto-config From e19046333baaf97f3a46ae9b456e130fa2795fb7 Mon Sep 17 00:00:00 2001 From: hilderic Date: Wed, 18 Mar 2020 17:22:27 +0100 Subject: [PATCH 2/7] yorc.nodes.aws.Subnet --- .../resources/aws/resources/resources.yaml | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/main/resources/aws/resources/resources.yaml b/src/main/resources/aws/resources/resources.yaml index f46019b..c3b57cc 100644 --- a/src/main/resources/aws/resources/resources.yaml +++ b/src/main/resources/aws/resources/resources.yaml @@ -108,6 +108,9 @@ node_types: derived_from: tosca.nodes.Network # See https://www.terraform.io/docs/providers/aws/r/vpc.html properties: + cidr_block: + type: string + required: true instance_tenancy: type: string description: > @@ -147,6 +150,45 @@ node_types: entry_schema: type: string + yorc.nodes.aws.Subnet: + derived_from: tosca.nodes.Network + # See : https://www.terraform.io/docs/providers/aws/r/subnet.html + properties: + availability_zone: + type: string + required: false + description: The AZ for the subnet + availability_zone_id: + type: string + required: false + description: The AZ for the subnet + cidr_block: + type: string + required: true + ipv6_cidr_block : + type: string + required: false + map_public_ip_on_launch: + type: boolean + required: false + description: The AZ for the subnet + assign_ipv6_address_on_creation: + type: boolean + required: false + description: > + Specify true to indicate that network interfaces created in the specified subnet should be assigned an IPv6 address + vpc_id: + type: string + required: true + tags: + type: map + description: A mapping of tags to assign to the resource. + required: false + entry_schema: + type: string + + + ############################################## # Abstract resources used for auto-config ############################################## From 0a71951778e614fd7958480a640aad00f105ae46 Mon Sep 17 00:00:00 2001 From: hilderic Date: Fri, 3 Apr 2020 09:09:49 +0200 Subject: [PATCH 3/7] yorc.nodes.aws.Subnet --- src/main/resources/aws/resources/resources.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/resources/aws/resources/resources.yaml b/src/main/resources/aws/resources/resources.yaml index c3b57cc..60d0b41 100644 --- a/src/main/resources/aws/resources/resources.yaml +++ b/src/main/resources/aws/resources/resources.yaml @@ -161,17 +161,18 @@ node_types: availability_zone_id: type: string required: false - description: The AZ for the subnet + description: The AZ ID for the subnet cidr_block: type: string required: true ipv6_cidr_block : type: string required: false + description: The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length. map_public_ip_on_launch: type: boolean required: false - description: The AZ for the subnet + description: Specify true to indicate that instances launched into the subnet should be assigned a public IP address. assign_ipv6_address_on_creation: type: boolean required: false @@ -179,7 +180,7 @@ node_types: Specify true to indicate that network interfaces created in the specified subnet should be assigned an IPv6 address vpc_id: type: string - required: true + required: false tags: type: map description: A mapping of tags to assign to the resource. From 06c29bd4dbb535f6c2e5e1c8477f3b1e244392f5 Mon Sep 17 00:00:00 2001 From: hilderic Date: Mon, 6 Apr 2020 15:31:54 +0200 Subject: [PATCH 4/7] yorc.aws.types.version updated --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b5eb94e..cd6aba6 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ 1.1.0 - 1.1.0 + 1.2.0 1.0.0 1.1.0 ${project.version} From d3bca5e1e253b071f4ca5998054f68820fb46b4c Mon Sep 17 00:00:00 2001 From: hilderic Date: Tue, 7 Apr 2020 13:15:10 +0200 Subject: [PATCH 5/7] subnet_id added to yorc.nodes.aws.Compute --- src/main/resources/aws/resources/resources.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/resources/aws/resources/resources.yaml b/src/main/resources/aws/resources/resources.yaml index 60d0b41..90bd4e9 100644 --- a/src/main/resources/aws/resources/resources.yaml +++ b/src/main/resources/aws/resources/resources.yaml @@ -32,6 +32,11 @@ node_types: description: > Coma separated list of security groups to add to the Compute required: true + subnet_id: + type: string + description: > + The VPC Subnet ID to launch in. + required: false availability_zone: type: string required: false From f66a8dc8fe7e154f5c5660f45758138c8e5715b7 Mon Sep 17 00:00:00 2001 From: hilderic Date: Tue, 14 Apr 2020 11:38:18 +0200 Subject: [PATCH 6/7] Implementing Security Groups WIP --- .../resources/aws/resources/resources.yaml | 163 ++++++++++++++---- 1 file changed, 127 insertions(+), 36 deletions(-) diff --git a/src/main/resources/aws/resources/resources.yaml b/src/main/resources/aws/resources/resources.yaml index 90bd4e9..9eef09a 100644 --- a/src/main/resources/aws/resources/resources.yaml +++ b/src/main/resources/aws/resources/resources.yaml @@ -12,6 +12,81 @@ imports: - tosca-normative-types:${tosca.normative.types.version} - yorc-types:${yorc.types.version} +data_types: + yorc.datatypes.aws.SubnetType: + derived_from: tosca.datatypes.Root + # See : https://www.terraform.io/docs/providers/aws/r/subnet.html + properties: + availability_zone: + type: string + required: false + description: The AZ for the subnet + availability_zone_id: + type: string + required: false + description: The AZ ID for the subnet + cidr_block: + type: string + required: true + ipv6_cidr_block : + type: string + required: false + description: The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length. + map_public_ip_on_launch: + type: boolean + required: false + description: Specify true to indicate that instances launched into the subnet should be assigned a public IP address. + assign_ipv6_address_on_creation: + type: boolean + required: false + description: > + Specify true to indicate that network interfaces created in the specified subnet should be assigned an IPv6 address + tags: + type: map + description: A mapping of tags to assign to the resource. + required: false + entry_schema: + type: string + + yorc.datatypes.aws.SecurityRuleType: + derived_from: tosca.datatypes.Root + # See : https://www.terraform.io/docs/providers/aws/r/subnet.html + properties: + from_port: + type: string + required: true + to_port: + type: string + required: true + protocol: + type: string + required: true + + yorc.datatypes.aws.SecurityGroupType: + derived_from: tosca.datatypes.Root + # See : https://www.terraform.io/docs/providers/aws/r/subnet.html + properties: + name: + type: string + required: true + ingress: + type: yorc.datatypes.aws.SecurityRuleType + required: true + egress: + type: yorc.datatypes.aws.SecurityRuleType + required: true + +relationship_types: + yorc.relationships.aws.Network: + derived_from: tosca.relationships.Network + properties: + subnet_id: + type: string + required: true + security_group: + type: string + required: true + node_types: yorc.nodes.aws.Compute: derived_from: yorc.nodes.Compute @@ -109,6 +184,44 @@ node_types: required: false default: false + yorc.nodes.aws.Subnet: + derived_from: tosca.nodes.Network + # See : https://www.terraform.io/docs/providers/aws/r/subnet.html + properties: + availability_zone: + type: string + required: false + description: The AZ for the subnet + availability_zone_id: + type: string + required: false + description: The AZ ID for the subnet + cidr_block: + type: string + required: true + ipv6_cidr_block : + type: string + required: false + description: The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length. + map_public_ip_on_launch: + type: boolean + required: false + description: Specify true to indicate that instances launched into the subnet should be assigned a public IP address. + assign_ipv6_address_on_creation: + type: boolean + required: false + description: > + Specify true to indicate that network interfaces created in the specified subnet should be assigned an IPv6 address + vpc_id: + type: string + required: true + tags: + type: map + description: A mapping of tags to assign to the resource. + required: false + entry_schema: + type: string + yorc.nodes.aws.VPC: derived_from: tosca.nodes.Network # See https://www.terraform.io/docs/providers/aws/r/vpc.html @@ -154,44 +267,22 @@ node_types: required: false entry_schema: type: string - - yorc.nodes.aws.Subnet: - derived_from: tosca.nodes.Network - # See : https://www.terraform.io/docs/providers/aws/r/subnet.html - properties: - availability_zone: - type: string - required: false - description: The AZ for the subnet - availability_zone_id: - type: string - required: false - description: The AZ ID for the subnet - cidr_block: - type: string + subnets: + type: list + description: Subnetworks in this VPC required: true - ipv6_cidr_block : - type: string - required: false - description: The IPv6 network range for the subnet, in CIDR notation. The subnet size must use a /64 prefix length. - map_public_ip_on_launch: - type: boolean - required: false - description: Specify true to indicate that instances launched into the subnet should be assigned a public IP address. - assign_ipv6_address_on_creation: - type: boolean - required: false - description: > - Specify true to indicate that network interfaces created in the specified subnet should be assigned an IPv6 address - vpc_id: - type: string - required: false - tags: - type: map - description: A mapping of tags to assign to the resource. - required: false entry_schema: - type: string + type: yorc.datatypes.aws.SubnetType + constraints: + - greater_or_equal: 1 + security_groups: + type: list + description: SecurityGroups in this VPC + required: true + entry_schema: + type: yorc.datatypes.aws.SecurityGroupType + constraints: + - greater_or_equal: 1 From aa64c4f7ea6320a6335c1f35e6bf26192a1d54d9 Mon Sep 17 00:00:00 2001 From: hilderic Date: Fri, 24 Apr 2020 10:21:05 +0200 Subject: [PATCH 7/7] fix --- .../resources/aws/resources/resources.yaml | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/main/resources/aws/resources/resources.yaml b/src/main/resources/aws/resources/resources.yaml index 9eef09a..e0139e6 100644 --- a/src/main/resources/aws/resources/resources.yaml +++ b/src/main/resources/aws/resources/resources.yaml @@ -76,17 +76,6 @@ data_types: type: yorc.datatypes.aws.SecurityRuleType required: true -relationship_types: - yorc.relationships.aws.Network: - derived_from: tosca.relationships.Network - properties: - subnet_id: - type: string - required: true - security_group: - type: string - required: true - node_types: yorc.nodes.aws.Compute: derived_from: yorc.nodes.Compute @@ -106,7 +95,7 @@ node_types: type: string description: > Coma separated list of security groups to add to the Compute - required: true + required: false subnet_id: type: string description: > @@ -270,19 +259,15 @@ node_types: subnets: type: list description: Subnetworks in this VPC - required: true + required: false entry_schema: type: yorc.datatypes.aws.SubnetType - constraints: - - greater_or_equal: 1 security_groups: type: list description: SecurityGroups in this VPC - required: true + required: false entry_schema: type: yorc.datatypes.aws.SecurityGroupType - constraints: - - greater_or_equal: 1