Skip to content

Commit 74b8fa0

Browse files
feat: added deployable architecture for IBM Cloud catalog (#650)
1 parent 3fc3593 commit 74b8fa0

21 files changed

+766
-2
lines changed

.catalog-onboard-pipeline.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
apiVersion: v1
3+
offerings:
4+
- name: deploy-arch-ibm-vpe-gateway
5+
kind: solution
6+
catalog_id: 7df1e4ca-d54c-4fd0-82ce-3d13247308cd
7+
offering_id: 0cb4c87d-e374-4113-9e69-c1deb00a17c5
8+
variations:
9+
- name: fully-configurable
10+
mark_ready: true
11+
install_type: fullstack
12+
pre_validation: "tests/scripts/pre-validation-deploy-vpc.sh"
13+
post_validation: "tests/scripts/post-validation-destroy-vpc.sh"
14+
scc:
15+
instance_id: 1c7d5f78-9262-44c3-b779-b28fe4d88c37
16+
region: us-south

.releaserc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
}],
1111
["@semantic-release/exec", {
1212
"successCmd": "echo \"SEMVER_VERSION=${nextRelease.version}\" >> $GITHUB_ENV"
13+
}],
14+
["@semantic-release/exec",{
15+
"publishCmd": "./ci/trigger-catalog-onboarding-pipeline.sh --version=v${nextRelease.version}"
1316
}]
1417
]
1518
}

.secrets.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.sum|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2023-12-10T07:29:36Z",
6+
"generated_at": "2023-12-11T07:29:36Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"

ibm_catalog.json

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
{
2+
"products": [
3+
{
4+
"name": "deploy-arch-ibm-vpe-gateway",
5+
"label": "Cloud automation for VPE gateway",
6+
"product_kind": "solution",
7+
"tags": [
8+
"ibm_created",
9+
"target_terraform",
10+
"terraform",
11+
"solution",
12+
"dev_ops"
13+
],
14+
"keywords": [
15+
"vpe",
16+
"IaC",
17+
"infrastructure as code",
18+
"terraform",
19+
"solution"
20+
],
21+
"short_description": "Creates and configures Virtual Private Endpoint gateway",
22+
"long_description": "This architecture supports creating and configuring Virtual Private Endpoint gateway.",
23+
"offering_docs_url": "https://github.com/terraform-ibm-modules/terraform-ibm-vpe-gateway/blob/main/README.md",
24+
"offering_icon_url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-scc/main/images/ibm-cloud.svg",
25+
"provider_name": "IBM",
26+
"features": [
27+
{
28+
"title": "IBM Cloud VPE gateway",
29+
"description": "Creates and configures an IBM Cloud VPE gateway."
30+
}
31+
],
32+
"flavors": [
33+
{
34+
"label": "Fully Configurable",
35+
"name": "fully-configurable",
36+
"install_type": "fullstack",
37+
"working_directory": "solutions/fully-configurable",
38+
"compliance": {},
39+
"configuration": [
40+
{
41+
"key": "ibmcloud_api_key"
42+
},
43+
{
44+
"custom_config": {
45+
"type": "region",
46+
"grouping": "deployment",
47+
"original_grouping": "deployment",
48+
"config_constraints": {
49+
"showKinds": [
50+
"region"
51+
]
52+
}
53+
},
54+
"key": "region",
55+
"required": true
56+
},
57+
{
58+
"key": "existing_resource_group_name",
59+
"required": true
60+
},
61+
{
62+
"key": "prefix",
63+
"required": true
64+
},
65+
{
66+
"key": "vpc_name",
67+
"required": true
68+
},
69+
{
70+
"key": "subnet_ids",
71+
"required": true
72+
},
73+
{
74+
"key": "security_group_ids"
75+
},
76+
{
77+
"key": "cloud_services"
78+
},
79+
{
80+
"key": "cloud_service_by_crn"
81+
},
82+
{
83+
"key": "service_endpoints"
84+
},
85+
{
86+
"key": "reserved_ips"
87+
}
88+
],
89+
"iam_permissions": [
90+
{
91+
"service_name": "is",
92+
"role_crns": [
93+
"crn:v1:bluemix:public:iam::::role:Editor"
94+
]
95+
}
96+
],
97+
"architecture": {
98+
"descriptions": "This architecture supports creating and configuring an IBM Cloud VPE gateway.",
99+
"features": [
100+
{
101+
"title": "VPE gateway creation",
102+
"description": "Yes"
103+
}
104+
],
105+
"diagrams": [
106+
{
107+
"diagram": {
108+
"caption": "VPE gateway",
109+
"url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-vpe-gateway/main/reference-architecture/vpe-catalog.svg",
110+
"type": "image/svg+xml"
111+
},
112+
"description": "This architecture supports creating an IBM Cloud VPE gateway"
113+
}
114+
]
115+
}
116+
}
117+
]
118+
}
119+
]
120+
}

reference-architecture/vpe-gateway.svg

Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Configuring complex inputs for Virtual Private Endpoint Gateways
2+
3+
Several optional input variables in the IBM Cloud [VPE Gateway deployable architecture](https://cloud.ibm.com/catalog#deployable_architecture) use complex object types. You specify these inputs when you configure deployable architecture.
4+
5+
You can specify a set of IBM Cloud services to create VPE endpoint gateways for. At least one of `cloud_services` or `cloud_service_by_crn` must be specified.
6+
7+
- [Cloud Services by name](#cloud-services) (`cloud_services`)
8+
- [Cloud Services by CRN](#cloud-service-by-crn) (`cloud_service_by_crn`)
9+
- [Reserved IPs](#reserved-ips) (`reserved_ips`)
10+
11+
## Cloud Services by name <a name="cloud-services"></a>
12+
13+
You can specify a set of IBM Cloud services by service name to create VPE Endpoint Gateways for. Use `cloud-services` for services that offer general service endpoints.
14+
15+
- Variable name: `cloud_services`.
16+
- Type: A list of objects that represent IBM Cloud services
17+
- Default value: An empty list (`[]`)
18+
19+
### Options for cloud_service
20+
21+
- `service_name` (required): The IBM Cloud service name.
22+
- `vpe_name` (optional): Full control on the VPE name. If not specified, the VPE name will be computed based on prefix, vpc name and service name.
23+
- `allow_dns_resolution_binding` (optional): Indicates whether to allow this endpoint gateway to participate in DNS resolution bindings with a VPC that has dns.enable_hub set to true.
24+
25+
### Example service credential
26+
27+
```hcl
28+
[
29+
{
30+
"service_name": "kms",
31+
"vpe_name": "kms-gateway",
32+
"allow_dns_resolution_binding": false
33+
},
34+
{
35+
"service_name": "cloud-object-storage"
36+
}
37+
]
38+
```
39+
40+
## Cloud Service by CRN <a name="cloud-service-by-crn"></a>
41+
42+
You can specify a set of IBM Cloud services by CRN to create VPE Endpoint Gateways for. Use `cloud-service-by-crn` for services that generate instance specific VPE gateway targets.
43+
44+
- Variable name: `cloud_service_by_crn`.
45+
- Type: A list of objects that represent IBM Cloud services
46+
- Default value: An empty list (`[]`)
47+
48+
### Options for cloud_service_by_crn
49+
50+
- `crn` (required): IBM Cloud service CRN.
51+
- `vpe_name` (optional): Full control on the VPE name. If not specified, the VPE name will be computed based on prefix, vpc name and service name.
52+
- `service_name` (optional):
53+
- `allow_dns_resolution_binding` (optional): Indicates whether to allow this endpoint gateway to participate in DNS resolution bindings with a VPC that has dns.enable_hub set to true.
54+
55+
### Example cloud_service_by_crn
56+
57+
```hcl
58+
[
59+
{
60+
"crn": "crn:version:cname:ctype:service-name:location:scope:service-instance::",
61+
"vpe_name": "service-gateway",
62+
"service_name": "service-name",
63+
"allow_dns_resolution_binding": false
64+
},
65+
{
66+
"crn": "crn:version:cname:ctype:service-name:location:scope:service-instance::"
67+
}
68+
]
69+
```
70+
71+
## Reserved IPs <a name="reserved-ips"></a>
72+
73+
Map of existing reserved IP names and values. If you wish to create your reserved ips independently and not create new ones you can first run the `reserved-ips` submodule and then copy the output `reserved_ip_map` here."
74+
75+
- Variable name: `reserved_ips`
76+
- Type: A map of existing reserved IP names and ids
77+
- Default value: An empty map (`{}`)
78+
79+
### Example reserved IPs
80+
81+
The following example shows values for both disk and memory for the `reserved_ips` input.
82+
83+
```hcl
84+
{
85+
"vpc-cloud-object-storage-1" = "0717-12345678-1234-1234-1234-123456789abc"
86+
"vpc-cloud-object-storage-2" = "0727-12345678-1234-1234-1234-123456789abc"
87+
"vpc-cloud-object-storage-3" = "0737-12345678-1234-1234-1234-123456789abc"
88+
"vpc-kms-1" = "0717-12345678-1234-1234-1234-123456789abc"
89+
"vpc-kms-2" = "0727-12345678-1234-1234-1234-123456789abc"
90+
"vpc-kms-3" = "0737-12345678-1234-1234-1234-123456789abc"
91+
}
92+
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Deploy Virtual Private Endpoint (VPE) gateways to Virtual Private Cloud (VPC)
2+
3+
This architecture creates and configures virtual private endpoint gateways to virtual private cloud.
4+
5+
## Before you begin
6+
7+
* You must have a Virtual Private Cloud instance.
8+
9+
**NB:** This solution is not intended to be called by one or more other modules since it contains a provider configurations, meaning it is not compatible with the `for_each`, `count`, and `depends_on` arguments. For more information see [Providers Within Modules](https://developer.hashicorp.com/terraform/language/modules/develop/providers)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"ibmcloud_api_key": $VALIDATION_APIKEY
3+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
########################################################################################################################
2+
# Resource group
3+
########################################################################################################################
4+
5+
module "resource_group" {
6+
source = "terraform-ibm-modules/resource-group/ibm"
7+
version = "1.1.6"
8+
existing_resource_group_name = var.existing_resource_group_name
9+
}
10+
11+
########################################################################################################################
12+
# VPC
13+
########################################################################################################################
14+
15+
data "ibm_is_vpc" "vpc" {
16+
name = var.vpc_name
17+
}
18+
19+
data "ibm_is_subnet" "subnet" {
20+
for_each = toset(var.subnet_ids)
21+
identifier = each.key
22+
}
23+
24+
locals {
25+
subnet_zone_list = [for subnet in data.ibm_is_subnet.subnet : {
26+
name = subnet.name
27+
id = subnet.id
28+
zone = subnet.zone
29+
}]
30+
}
31+
32+
########################################################################################################################
33+
# VPE
34+
########################################################################################################################
35+
36+
module "vpe" {
37+
source = "../.."
38+
region = var.region
39+
prefix = var.prefix
40+
resource_group_id = module.resource_group.resource_group_id
41+
vpc_name = var.vpc_name
42+
vpc_id = data.ibm_is_vpc.vpc.id
43+
subnet_zone_list = local.subnet_zone_list
44+
security_group_ids = var.security_group_ids
45+
cloud_services = var.cloud_services
46+
cloud_service_by_crn = var.cloud_service_by_crn
47+
service_endpoints = var.service_endpoints
48+
reserved_ips = var.reserved_ips
49+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
output "vpe_ips" {
2+
description = "The endpoint gateway reserved ips"
3+
value = module.vpe.vpe_ips
4+
}
5+
6+
output "crn" {
7+
description = "The CRN of the endpoint gateway"
8+
value = module.vpe.crn
9+
}

0 commit comments

Comments
 (0)