Skip to content

Commit

Permalink
add support for 4th zone (#5644)
Browse files Browse the repository at this point in the history
Co-authored-by: Ujjwal Kumar <[email protected]>
  • Loading branch information
2 people authored and hkantare committed Sep 22, 2024
1 parent c0ed7c9 commit 592ac0a
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 1 deletion.
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
# 1.70.0-beta0(Sep 22, 2024)

Breaking Changes
* update(cloud-databases): Make Service Endpoints as Required argument([5615](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5615))

Features
* Support IAM Access tag
- **Resources**
- ibm_iam_access_tag
* Support VPC
- **Resources**
- ibm_is_subnet_reserved_ip_patch
* Support code Engine
- **Resources**
- ibm_code_engine_function

Enhancements
* add service_to_service_enabled field to atracker event streams endpoint ([5605](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5605))
* Deprecated ibm_resource_access_tag and replaced it with ibm_iam_access_tag ([5567](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5567))
* SM New error formatting + crypto_key label name changes ([5562](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5562))
* Deprecating alias and bindings APIs and schema items ([5612](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5612))
* update(cloud-databases): Make Service Endpoints Required and send warning when public endpoints are in use ([5402](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5402))
* discourage use of ibm_container_bind_service ([5588](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5588))
* updated resources, data source and documentation for Slack Direct destination support ([5615](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5615))
* IAM Policy Assignment: S2S Policy Assignments ET and AG ([5624](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5624))
* fix for context and history parameter of template assignment ([5640](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5640))
* Updating to latest schematics sdk and updating sch_agent resource to enable force deletion by default ([5660](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5660))
* add support for 4th zone ([5644](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5644))

BugFixes
* The ibm_resource_tag do not detach if tag_type is access or service ([5566](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/5566))
* fix(is_share): added empty check and moved source_share_crn outside ([5632](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5632))
* Add test bucket endpoints ([5636](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5636))
* The ibm_resource_tag does not check the response on api tags calls ([5641](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/5641))

# 1.69.2(Sep 13, 2024)
* Add region parameter to logs-routing resources and data sources ([5634](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5634))
* fix(is_share): added empty check and moved source_share_crn outside ([5632](https://github.com/IBM-Cloud/terraform-provider-ibm/pull/5632))

# 1.69.1(Sep 10, 2024)
BugFixes
* BUG: 1.69.0 panic when attempting to update ibm_resource_instance ([5618](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/5618))
Expand Down
17 changes: 17 additions & 0 deletions ibm/service/vpc/data_source_ibm_is_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const (
isZoneName = "name"
isZoneRegion = "region"
isZoneStatus = "status"

isZoneDataCenter = "data_center"
isZoneUniversalName = "universal_name"
)

func DataSourceIBMISZone() *schema.Resource {
Expand All @@ -36,6 +39,14 @@ func DataSourceIBMISZone() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
isZoneDataCenter: {
Type: schema.TypeString,
Computed: true,
},
isZoneUniversalName: {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -65,5 +76,11 @@ func zoneGet(d *schema.ResourceData, meta interface{}, regionName, zoneName stri
d.Set(isZoneName, *zone.Name)
d.Set(isZoneRegion, *zone.Region.Name)
d.Set(isZoneStatus, *zone.Status)
if zone.DataCenter != nil {
d.Set(isZoneDataCenter, *zone.DataCenter)
}
if zone.UniversalName != nil {
d.Set(isZoneUniversalName, *zone.UniversalName)
}
return nil
}
2 changes: 2 additions & 0 deletions ibm/service/vpc/data_source_ibm_is_zone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ func TestAccIBMISZoneDataSource_basic(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.ibm_is_zone.testacc_ds_zone", "name", acc.ISZoneName),
resource.TestCheckResourceAttr("data.ibm_is_zone.testacc_ds_zone", "region", acc.RegionName),
resource.TestCheckResourceAttr("data.ibm_is_zone.testacc_ds_zone", "data_center", "DAL10"),
resource.TestCheckResourceAttr("data.ibm_is_zone.testacc_ds_zone", "universal_name", "us-south-dal10-a"),
),
},
},
Expand Down
38 changes: 38 additions & 0 deletions ibm/service/vpc/data_source_ibm_is_zones.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

const (
isZoneNames = "zones"
isZonesInfo = "zone_info"
)

func DataSourceIBMISZones() *schema.Resource {
Expand All @@ -35,6 +36,31 @@ func DataSourceIBMISZones() *schema.Resource {
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
isZonesInfo: {
Type: schema.TypeList,
Computed: true,
Description: "The zones information in the region",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
isZoneName: {
Type: schema.TypeString,
Computed: true,
},
isZoneUniversalName: {
Type: schema.TypeString,
Computed: true,
},
isZoneDataCenter: {
Type: schema.TypeString,
Computed: true,
},
isZoneStatus: {
Type: schema.TypeString,
Computed: true,
},
},
},
},
},
}
}
Expand All @@ -59,13 +85,25 @@ func zonesList(d *schema.ResourceData, meta interface{}, regionName string) erro
}
names := make([]string, 0)
status := d.Get(isZoneStatus).(string)
zonesList := make([]map[string]interface{}, 0)
for _, zone := range availableZones.Zones {
zoneInfo := map[string]interface{}{}
if status == "" || *zone.Status == status {
names = append(names, *zone.Name)
zoneInfo[isZoneName] = *zone.Name
zoneInfo[isZoneStatus] = *zone.Status
if zone.DataCenter != nil {
zoneInfo[isZoneDataCenter] = *zone.DataCenter
}
if zone.UniversalName != nil {
zoneInfo[isZoneUniversalName] = *zone.UniversalName
}
}
zonesList = append(zonesList, zoneInfo)
}
d.SetId(dataSourceIBMISZonesId(d))
d.Set(isZoneNames, names)
d.Set(isZonesInfo, zonesList)
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

// Version is the current provider main version
const Version = "1.69.1"
const Version = "1.70.0-beta0"

// GitCommit is the git commit that was compiled. This will be filled in by the compiler.
var GitCommit string
Expand Down
2 changes: 2 additions & 0 deletions website/docs/d/is_zone.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ Review the argument references that you can specify for your data source.
In addition to all argument reference list, you can access the following attribute references after your data source is created.

- `status` - (String) The status of the zone.
- `data_center` - (String) The physical data center assigned to this logical zone. If absent, no physical data center has been assigned.
- `universal_name` - (String) The universal name for this zone. Will be absent if this zone has a status of unassigned.
6 changes: 6 additions & 0 deletions website/docs/d/is_zones.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,9 @@ Review the argument references that you can specify for your data source.
In addition to all argument reference list, you can access the following attribute references after your data source is created.

- `zones` - (String) The list of zones in an IBM Cloud region. For example, **us-south-1**,**us-south-2**.
- `zone_info` - (List) Collection of zones.
Nested schema for **zone_info**:
- `data_center` - (String) The physical data center assigned to this logical zone. If absent, no physical data center has been assigned.
- `name` - (String) The name of the zone.
- `status` - (String) The status of the zone.
- `universal_name` - (String) The universal name for this zone. Will be absent if this zone has a status of unassigned.

0 comments on commit 592ac0a

Please sign in to comment.