Skip to content

Commit 1dfd73c

Browse files
Khuzaima05Khuzaima-Shakeel
andauthored
refactor: remove unused VPC resources from apps example (#322)
* refactor: Remove unused VPC resources from apps example * SKIP UPGRADE TEST --------- Co-authored-by: Khuzaima-Shakeel <Khuzaima.Shakeel@ibm.com>
1 parent 216f1df commit 1dfd73c

3 files changed

Lines changed: 4 additions & 51 deletions

File tree

examples/apps/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ An end-to-end apps example that will provision the following:
1313
- Code Engine TLS Secret
1414
- Code Engine Domain Mapping
1515
- Secrets Manager Resources (Public Engine, Group, Public Certificate)
16-
- A Virtual Private Cloud (VPC).
17-
- A context-based restriction (CBR) rule to allow Code Engine to be accessible from VPC and Schematics.
16+
- A context-based restriction (CBR) rule to allow Code Engine to be accessible from Schematics.
1817

1918
<!-- BEGIN SCHEMATICS DEPLOY TIP HOOK -->
2019
:information_source: Ctrl/Cmd+Click or right-click on the Schematics deploy button to open in a new tab

examples/apps/main.tf

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -104,39 +104,10 @@ data "ibm_sm_public_certificate" "public_certificate" {
104104
data "ibm_iam_account_settings" "iam_account_settings" {
105105
}
106106

107-
##############################################################################
108-
# VPC
109-
##############################################################################
110-
resource "ibm_is_vpc" "example_vpc" {
111-
name = "${var.prefix}-vpc"
112-
resource_group = module.resource_group.resource_group_id
113-
tags = var.resource_tags
114-
}
115-
116-
resource "ibm_is_subnet" "testacc_subnet" {
117-
name = "${var.prefix}-subnet"
118-
vpc = ibm_is_vpc.example_vpc.id
119-
zone = "${var.region}-1"
120-
total_ipv4_address_count = 256
121-
resource_group = module.resource_group.resource_group_id
122-
}
123-
124107
##############################################################################
125108
# Create CBR Zone
126109
##############################################################################
127110

128-
module "cbr_vpc_zone" {
129-
source = "terraform-ibm-modules/cbr/ibm//modules/cbr-zone-module"
130-
version = "1.36.0"
131-
name = "${var.prefix}-VPC-network-zone"
132-
zone_description = "CBR Network zone representing VPC"
133-
account_id = data.ibm_iam_account_settings.iam_account_settings.account_id
134-
addresses = [{
135-
type = "vpc",
136-
value = ibm_is_vpc.example_vpc.crn
137-
}]
138-
}
139-
140111
module "cbr_zone_schematics" {
141112
source = "terraform-ibm-modules/cbr/ibm//modules/cbr-zone-module"
142113
version = "1.36.0"
@@ -168,21 +139,11 @@ module "code_engine" {
168139
account_id = data.ibm_iam_account_settings.iam_account_settings.account_id
169140
rule_contexts = [{
170141
attributes = [
171-
{
172-
"name" : "endpointType",
173-
"value" : "public"
174-
},
175142
{
176143
name = "networkZoneId"
177-
value = module.cbr_vpc_zone.zone_id
178-
}]
179-
},
180-
{
181-
attributes = [
182-
{
183-
name = "networkZoneId"
184-
value = module.cbr_zone_schematics.zone_id
185-
}]
144+
value = module.cbr_zone_schematics.zone_id
145+
}
146+
]
186147
}]
187148
operations = [{
188149
api_types = [{

examples/apps/variables.tf

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@ variable "resource_group" {
2626
default = null
2727
}
2828

29-
variable "resource_tags" {
30-
type = list(string)
31-
description = "Optional list of tags to be added to created resources"
32-
default = []
33-
}
34-
35-
3629
##############################################################
3730
# Secret Manager
3831
##############################################################

0 commit comments

Comments
 (0)