Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for the user_data variable #916

Open
wants to merge 55 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
8e84f61
fix: deploy vsi only to the vsi-zone-* subnets for null value
Aashiq-J Dec 19, 2023
0e714cd
add upgrade test
Aashiq-J Dec 20, 2023
dacb943
Merge branch 'main' into default-subnet
Aashiq-J Dec 20, 2023
def2882
setupoptions for vsi extension
Aashiq-J Dec 22, 2023
8bda819
Merge branch 'main' into default-subnet
Aashiq-J Jan 4, 2024
aabe4a0
Merge branch 'main' into default-subnet
Aashiq-J Jan 8, 2024
c447184
Merge branch 'main' into default-subnet
Aashiq-J Jan 9, 2024
03b5ea3
Merge branch 'main' of https://github.com/terraform-ibm-modules/terra…
Aashiq-J Jan 17, 2024
fae81b1
Merge branch 'main' of https://github.com/terraform-ibm-modules/terra…
Aashiq-J Aug 9, 2024
4ea6a9e
Merge branch 'main' of https://github.com/terraform-ibm-modules/terra…
Aashiq-J Aug 12, 2024
7880317
update version
Aashiq-J Aug 12, 2024
fb8c233
test
Aashiq-J Aug 12, 2024
b89b41d
test
Aashiq-J Aug 13, 2024
823ddf1
test
Aashiq-J Aug 13, 2024
609d9d8
test
Aashiq-J Aug 13, 2024
f7ac05c
update
Aashiq-J Aug 13, 2024
e24777a
update script
Aashiq-J Aug 13, 2024
c80902c
Merge branch 'main' of https://github.com/terraform-ibm-modules/terra…
Aashiq-J Sep 20, 2024
82f9abd
remove script from this PR
Aashiq-J Sep 20, 2024
966143a
Merge branch 'main' into default-subnet
Aashiq-J Sep 23, 2024
172a585
disable use_ibm_cloud_private_api_endpoints for other upgrade test wh…
Aashiq-J Sep 23, 2024
323cd1a
revert readme
Aashiq-J Sep 23, 2024
23389f7
SKIP UPGRADE TEST
Aashiq-J Sep 23, 2024
5cd849a
some variable fixes
Aashiq-J Sep 24, 2024
0708fdf
feat: add support for user_data
Aashiq-J Nov 11, 2024
675e099
feat: add support for migration path
Aashiq-J Nov 12, 2024
fbe827b
Merge branch 'main' of https://github.com/terraform-ibm-modules/terra…
Aashiq-J Nov 12, 2024
f0b52bc
Merge branch 'migration' of https://github.com/terraform-ibm-modules/…
Aashiq-J Nov 12, 2024
117cebf
test
Aashiq-J Nov 13, 2024
32566f0
update
Aashiq-J Nov 13, 2024
2e84e77
updates
Aashiq-J Nov 13, 2024
2084f0a
Merge branch 'main' of https://github.com/terraform-ibm-modules/terra…
Aashiq-J Nov 15, 2024
ca5f2db
test: just run TestRunUpgradeVsiExtention
Aashiq-J Nov 15, 2024
2534f45
revert
Aashiq-J Nov 15, 2024
e7e036e
move tests
Aashiq-J Nov 15, 2024
6f42362
remove scripts
Aashiq-J Nov 18, 2024
5999d71
remove a parameter
Aashiq-J Nov 18, 2024
f97d369
update vsi module version
Aashiq-J Nov 19, 2024
5a4a539
move test to main pr test
Aashiq-J Nov 21, 2024
b583867
update vsi version
Aashiq-J Nov 28, 2024
348849d
Merge branch 'default-subnet' of https://github.com/terraform-ibm-mod…
Aashiq-J Nov 28, 2024
056e2d3
Merge branch 'main' into user_data
imprateeksh Dec 1, 2024
237d40d
Merge branch 'main' into user_data
imprateeksh Dec 8, 2024
7a6fc33
Merge branch 'main' into user_data
imprateeksh Dec 9, 2024
7650730
Merge branch 'main' into user_data
imprateeksh Dec 10, 2024
03c2ba2
Merge branch 'main' of https://github.com/terraform-ibm-modules/terra…
Aashiq-J Dec 13, 2024
2de1912
review changes
Aashiq-J Dec 13, 2024
2146a80
fix: invalid index for rg output values when override set to true
Aashiq-J Dec 13, 2024
20aa261
update logic
Aashiq-J Dec 13, 2024
b70fcda
Merge branch 'rg-output' of https://github.com/terraform-ibm-modules/…
Aashiq-J Dec 13, 2024
55e7177
Merge branch 'main' into user_data
Aashiq-J Dec 17, 2024
e57e2c6
revert few changes
Aashiq-J Dec 17, 2024
8eddf69
update variable description
Aashiq-J Dec 17, 2024
e520bd6
Merge branch 'main' into user_data
Aashiq-J Dec 20, 2024
b423dc0
Merge branch 'main' into user_data
Aashiq-J Dec 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ module "cluster_pattern" {

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9 |
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.68.1, < 2.0.0 |
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.4.3, < 4.0.0 |
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.9.1, < 1.0.0 |
Expand Down Expand Up @@ -934,6 +934,7 @@ module "cluster_pattern" {
| <a name="input_transit_gateway_connections"></a> [transit\_gateway\_connections](#input\_transit\_gateway\_connections) | Transit gateway vpc connections. Will only be used if transit gateway is enabled. | `list(string)` | n/a | yes |
| <a name="input_transit_gateway_global"></a> [transit\_gateway\_global](#input\_transit\_gateway\_global) | Connect to the networks outside the associated region. Will only be used if transit gateway is enabled. | `bool` | `false` | no |
| <a name="input_transit_gateway_resource_group"></a> [transit\_gateway\_resource\_group](#input\_transit\_gateway\_resource\_group) | Name of resource group to use for transit gateway. Must be included in `var.resource_group` | `string` | n/a | yes |
| <a name="input_user_data"></a> [user\_data](#input\_user\_data) | User data that automatically performs common configuration tasks or runs scripts. For more information, see https://cloud.ibm.com/docs/vpc?topic=vpc-user-data. | <pre>map(object({<br/> user_data = string<br/> }))</pre> | `{}` | no |
| <a name="input_virtual_private_endpoints"></a> [virtual\_private\_endpoints](#input\_virtual\_private\_endpoints) | Object describing VPE to be created | <pre>list(<br/> object({<br/> service_name = string<br/> service_type = string<br/> resource_group = optional(string)<br/> access_tags = optional(list(string), [])<br/> vpcs = list(<br/> object({<br/> name = string<br/> subnets = list(string)<br/> security_group_name = optional(string)<br/> })<br/> )<br/> })<br/> )</pre> | n/a | yes |
| <a name="input_vpc_placement_groups"></a> [vpc\_placement\_groups](#input\_vpc\_placement\_groups) | List of VPC placement groups to create | <pre>list(<br/> object({<br/> access_tags = optional(list(string), [])<br/> name = string<br/> resource_group = optional(string)<br/> strategy = string<br/> })<br/> )</pre> | `[]` | no |
| <a name="input_vpcs"></a> [vpcs](#input\_vpcs) | A map describing VPCs to be created in this repo. | <pre>list(<br/> object({<br/> prefix = string # VPC prefix<br/> existing_vpc_id = optional(string)<br/> existing_subnets = optional(<br/> list(<br/> object({<br/> id = string<br/> public_gateway = optional(bool, false)<br/> })<br/> )<br/> )<br/> resource_group = optional(string) # Name of the group where VPC will be created<br/> access_tags = optional(list(string), [])<br/> classic_access = optional(bool)<br/> default_network_acl_name = optional(string)<br/> default_security_group_name = optional(string)<br/> clean_default_sg_acl = optional(bool, false)<br/> dns_binding_name = optional(string, null)<br/> dns_instance_name = optional(string, null)<br/> dns_custom_resolver_name = optional(string, null)<br/> dns_location = optional(string, "global")<br/> dns_plan = optional(string, "standard-dns")<br/> existing_dns_instance_id = optional(string, null)<br/> use_existing_dns_instance = optional(bool, false)<br/> enable_hub = optional(bool, false)<br/> skip_spoke_auth_policy = optional(bool, false)<br/> hub_account_id = optional(string, null)<br/> enable_hub_vpc_id = optional(bool, false)<br/> hub_vpc_id = optional(string, null)<br/> enable_hub_vpc_crn = optional(bool, false)<br/> hub_vpc_crn = optional(string, null)<br/> update_delegated_resolver = optional(bool, false)<br/> skip_custom_resolver_hub_creation = optional(bool, false)<br/> resolver_type = optional(string, null)<br/> manual_servers = optional(list(object({<br/> address = string<br/> zone_affinity = optional(string)<br/> })), [])<br/> default_security_group_rules = optional(<br/> list(<br/> object({<br/> name = string<br/> direction = string<br/> remote = string<br/> tcp = optional(<br/> object({<br/> port_max = optional(number)<br/> port_min = optional(number)<br/> })<br/> )<br/> udp = optional(<br/> object({<br/> port_max = optional(number)<br/> port_min = optional(number)<br/> })<br/> )<br/> icmp = optional(<br/> object({<br/> type = optional(number)<br/> code = optional(number)<br/> })<br/> )<br/> })<br/> )<br/> )<br/> default_routing_table_name = optional(string)<br/> flow_logs_bucket_name = optional(string)<br/> address_prefixes = optional(<br/> object({<br/> zone-1 = optional(list(string))<br/> zone-2 = optional(list(string))<br/> zone-3 = optional(list(string))<br/> })<br/> )<br/> network_acls = list(<br/> object({<br/> name = string<br/> add_ibm_cloud_internal_rules = optional(bool)<br/> add_vpc_connectivity_rules = optional(bool)<br/> prepend_ibm_rules = optional(bool)<br/> rules = list(<br/> object({<br/> name = string<br/> action = string<br/> destination = string<br/> direction = string<br/> source = string<br/> tcp = optional(<br/> object({<br/> port_max = optional(number)<br/> port_min = optional(number)<br/> source_port_max = optional(number)<br/> source_port_min = optional(number)<br/> })<br/> )<br/> udp = optional(<br/> object({<br/> port_max = optional(number)<br/> port_min = optional(number)<br/> source_port_max = optional(number)<br/> source_port_min = optional(number)<br/> })<br/> )<br/> icmp = optional(<br/> object({<br/> type = optional(number)<br/> code = optional(number)<br/> })<br/> )<br/> })<br/> )<br/> })<br/> )<br/> use_public_gateways = object({<br/> zone-1 = optional(bool)<br/> zone-2 = optional(bool)<br/> zone-3 = optional(bool)<br/> })<br/> subnets = optional(object({<br/> zone-1 = list(object({<br/> name = string<br/> cidr = string<br/> public_gateway = optional(bool)<br/> acl_name = string<br/> no_addr_prefix = optional(bool, false)<br/> }))<br/> zone-2 = list(object({<br/> name = string<br/> cidr = string<br/> public_gateway = optional(bool)<br/> acl_name = string<br/> no_addr_prefix = optional(bool, false)<br/> }))<br/> zone-3 = list(object({<br/> name = string<br/> cidr = string<br/> public_gateway = optional(bool)<br/> acl_name = string<br/> no_addr_prefix = optional(bool, false)<br/> }))<br/> }))<br/> })<br/> )</pre> | n/a | yes |
Expand Down
1 change: 1 addition & 0 deletions dynamic_values.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module "dynamic_values" {
skip_kms_kube_s2s_auth_policy = var.skip_kms_kube_s2s_auth_policy
skip_all_s2s_auth_policies = var.skip_all_s2s_auth_policies
atracker_cos_bucket = var.atracker.add_route == true ? var.atracker.collector_bucket_name : null
user_data = var.user_data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes will not be needed if you assign the user_data to the VSI object out in the pattern level as suggested.

}

##############################################################################
2 changes: 1 addition & 1 deletion dynamic_values/config_modules/appid/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
2 changes: 1 addition & 1 deletion dynamic_values/config_modules/clusters/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
2 changes: 1 addition & 1 deletion dynamic_values/config_modules/cos/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
2 changes: 1 addition & 1 deletion dynamic_values/config_modules/f5/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
2 changes: 1 addition & 1 deletion dynamic_values/config_modules/flow_logs/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
2 changes: 1 addition & 1 deletion dynamic_values/config_modules/get_subnets/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
2 changes: 1 addition & 1 deletion dynamic_values/config_modules/list_to_map/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
2 changes: 1 addition & 1 deletion dynamic_values/config_modules/vpe/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
2 changes: 1 addition & 1 deletion dynamic_values/config_modules/vpn/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
10 changes: 10 additions & 0 deletions dynamic_values/config_modules/vsi/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,13 @@ variable "bastion_vsi" {
}

##############################################################################

##############################################################################
# User Data
##############################################################################

variable "user_data" {
description = "Direct reference to user_data"
}

##############################################################################
2 changes: 1 addition & 1 deletion dynamic_values/config_modules/vsi/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
5 changes: 3 additions & 2 deletions dynamic_values/config_modules/vsi/vsi.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ module "composed_vsi_map" {
list = [
for vsi_group in var.vsi :
merge(vsi_group, {
vpc_id = var.vpc_modules[vsi_group.vpc_name].vpc_id
subnets = module.vsi_subnets["${var.prefix}-${vsi_group.name}"].subnets
vpc_id = var.vpc_modules[vsi_group.vpc_name].vpc_id
subnets = module.vsi_subnets["${var.prefix}-${vsi_group.name}"].subnets
user_data = lookup(var.user_data, vsi_group.vpc_name, null) != null ? var.user_data[vsi_group.vpc_name].user_data : null
})
]
}
Expand Down
4 changes: 4 additions & 0 deletions dynamic_values/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ variable "ssh_keys" {
description = "Direct reference to SSH keys"
}

variable "user_data" {
description = "Direct reference to user_data"
}

##############################################################################

##############################################################################
Expand Down
2 changes: 1 addition & 1 deletion dynamic_values/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
3 changes: 3 additions & 0 deletions dynamic_values/vsi.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module "vsi" {
vpc_modules = var.vpc_modules
vsi = var.vsi
bastion_vsi = var.bastion_vsi
user_data = var.user_data
}

##############################################################################
Expand Down Expand Up @@ -42,6 +43,7 @@ module "ut_ssh_key" {
}
]
vpc_modules = {}
user_data = {}
vsi = []
bastion_vsi = []
}
Expand All @@ -63,6 +65,7 @@ module "ut_vsi_images" {
prefix = "ut"
resource_groups = {}
ssh_keys = []
user_data = {}
vpc_modules = {
test = {
vpc_id = "1234"
Expand Down
2 changes: 1 addition & 1 deletion examples/one-vpc-one-vsi/version.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
Expand Down
2 changes: 1 addition & 1 deletion examples/override-example/version.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
Expand Down
2 changes: 1 addition & 1 deletion f5_config/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
16 changes: 16 additions & 0 deletions ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@
},
"key": "override_json_string"
},
{
"custom_config": {
"grouping": "deployment",
"original_grouping": "deployment",
"type": "textarea"
},
"key": "user_data"
},
{
"custom_config": {
"config_constraints": {
Expand Down Expand Up @@ -327,6 +335,14 @@
},
"key": "override_json_string"
},
{
"custom_config": {
"grouping": "deployment",
"original_grouping": "deployment",
"type": "textarea"
},
"key": "user_data"
},
{
"hidden": true,
"key": "tmos_admin_password",
Expand Down
2 changes: 1 addition & 1 deletion kms/dynamic_values/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
2 changes: 1 addition & 1 deletion kms/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ terraform {
version = ">= 1.60.0, < 2.0.0"
}
}
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##############################################################################

terraform {
required_version = ">= 1.3"
required_version = ">= 1.9"
}

##############################################################################
Loading