Skip to content

Commit 867f806

Browse files
Rajat Kotisahilg11
authored andcommitted
Added - terraform changes for lldp
1 parent 733034c commit 867f806

30 files changed

+243
-93
lines changed

internal/integrationtest/core_cross_connect_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ func TestCoreCrossConnectResource_basic(t *testing.T) {
239239
resource.TestCheckResourceAttrSet(datasourceName, "cross_connects.0.macsec_properties.0.primary_key.0.connectivity_association_key_secret_version"),
240240
resource.TestCheckResourceAttrSet(datasourceName, "cross_connects.0.macsec_properties.0.primary_key.0.connectivity_association_name_secret_id"),
241241
resource.TestCheckResourceAttrSet(datasourceName, "cross_connects.0.macsec_properties.0.primary_key.0.connectivity_association_name_secret_version"),
242+
resource.TestCheckResourceAttrSet(datasourceName, "cross_connects.0.oci_logical_device_name"),
243+
resource.TestCheckResourceAttrSet(datasourceName, "cross_connects.0.oci_physical_device_name"),
242244
resource.TestCheckResourceAttr(datasourceName, "cross_connects.0.macsec_properties.0.state", "ENABLED"),
243245
resource.TestCheckResourceAttrSet(datasourceName, "cross_connects.0.port_name"),
244246
resource.TestCheckResourceAttr(datasourceName, "cross_connects.0.port_speed_shape_name", "10 Gbps"),
@@ -266,6 +268,8 @@ func TestCoreCrossConnectResource_basic(t *testing.T) {
266268
resource.TestCheckResourceAttr(singularDatasourceName, "macsec_properties.0.primary_key.#", "1"),
267269
resource.TestCheckResourceAttrSet(singularDatasourceName, "macsec_properties.0.primary_key.0.connectivity_association_key_secret_version"),
268270
resource.TestCheckResourceAttrSet(singularDatasourceName, "macsec_properties.0.primary_key.0.connectivity_association_name_secret_version"),
271+
resource.TestCheckResourceAttrSet(singularDatasourceName, "oci_logical_device_name"),
272+
resource.TestCheckResourceAttrSet(singularDatasourceName, "oci_physical_device_name"),
269273
resource.TestCheckResourceAttr(singularDatasourceName, "macsec_properties.0.state", "ENABLED"),
270274
resource.TestCheckResourceAttrSet(singularDatasourceName, "port_name"),
271275
resource.TestCheckResourceAttr(singularDatasourceName, "port_speed_shape_name", "10 Gbps"),

internal/service/core/core_cross_connect_data_source.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ func (s *CoreCrossConnectDataSourceCrud) SetData() error {
9898
s.D.Set("macsec_properties", nil)
9999
}
100100

101+
if s.Res.OciLogicalDeviceName != nil {
102+
s.D.Set("oci_logical_device_name", *s.Res.OciLogicalDeviceName)
103+
}
104+
105+
if s.Res.OciPhysicalDeviceName != nil {
106+
s.D.Set("oci_physical_device_name", *s.Res.OciPhysicalDeviceName)
107+
}
108+
101109
if s.Res.PortName != nil {
102110
s.D.Set("port_name", *s.Res.PortName)
103111
}

internal/service/core/core_cross_connect_group_data_source.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ func (s *CoreCrossConnectGroupDataSourceCrud) SetData() error {
9090
s.D.Set("macsec_properties", nil)
9191
}
9292

93+
if s.Res.OciLogicalDeviceName != nil {
94+
s.D.Set("oci_logical_device_name", *s.Res.OciLogicalDeviceName)
95+
}
96+
97+
if s.Res.OciPhysicalDeviceName != nil {
98+
s.D.Set("oci_physical_device_name", *s.Res.OciPhysicalDeviceName)
99+
}
100+
93101
s.D.Set("state", s.Res.LifecycleState)
94102

95103
if s.Res.TimeCreated != nil {

internal/service/core/core_cross_connect_group_resource.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ func CoreCrossConnectGroupResource() *schema.Resource {
115115
},
116116

117117
// Computed
118+
"oci_logical_device_name": {
119+
Type: schema.TypeString,
120+
Computed: true,
121+
},
122+
"oci_physical_device_name": {
123+
Type: schema.TypeString,
124+
Computed: true,
125+
},
118126
"state": {
119127
Type: schema.TypeString,
120128
Computed: true,
@@ -374,6 +382,14 @@ func (s *CoreCrossConnectGroupResourceCrud) SetData() error {
374382
s.D.Set("macsec_properties", nil)
375383
}
376384

385+
if s.Res.OciLogicalDeviceName != nil {
386+
s.D.Set("oci_logical_device_name", *s.Res.OciLogicalDeviceName)
387+
}
388+
389+
if s.Res.OciPhysicalDeviceName != nil {
390+
s.D.Set("oci_physical_device_name", *s.Res.OciPhysicalDeviceName)
391+
}
392+
377393
s.D.Set("state", s.Res.LifecycleState)
378394

379395
if s.Res.TimeCreated != nil {

internal/service/core/core_cross_connect_groups_data_source.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@ func (s *CoreCrossConnectGroupsDataSourceCrud) SetData() error {
134134
crossConnectGroup["macsec_properties"] = nil
135135
}
136136

137+
if r.OciLogicalDeviceName != nil {
138+
crossConnectGroup["oci_logical_device_name"] = *r.OciLogicalDeviceName
139+
}
140+
141+
if r.OciPhysicalDeviceName != nil {
142+
crossConnectGroup["oci_physical_device_name"] = *r.OciPhysicalDeviceName
143+
}
144+
137145
crossConnectGroup["state"] = r.LifecycleState
138146

139147
if r.TimeCreated != nil {

internal/service/core/core_cross_connect_resource.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ func CoreCrossConnectResource() *schema.Resource {
151151
},
152152

153153
// Computed
154+
"oci_logical_device_name": {
155+
Type: schema.TypeString,
156+
Computed: true,
157+
},
158+
"oci_physical_device_name": {
159+
Type: schema.TypeString,
160+
Computed: true,
161+
},
154162
"port_name": {
155163
Type: schema.TypeString,
156164
Computed: true,
@@ -474,6 +482,14 @@ func (s *CoreCrossConnectResourceCrud) SetData() error {
474482
s.D.Set("macsec_properties", nil)
475483
}
476484

485+
if s.Res.OciLogicalDeviceName != nil {
486+
s.D.Set("oci_logical_device_name", *s.Res.OciLogicalDeviceName)
487+
}
488+
489+
if s.Res.OciPhysicalDeviceName != nil {
490+
s.D.Set("oci_physical_device_name", *s.Res.OciPhysicalDeviceName)
491+
}
492+
477493
if s.Res.PortName != nil {
478494
s.D.Set("port_name", *s.Res.PortName)
479495
}

internal/service/core/core_cross_connects_data_source.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ func (s *CoreCrossConnectsDataSourceCrud) SetData() error {
151151
crossConnect["macsec_properties"] = nil
152152
}
153153

154+
if r.OciLogicalDeviceName != nil {
155+
crossConnect["oci_logical_device_name"] = *r.OciLogicalDeviceName
156+
}
157+
158+
if r.OciPhysicalDeviceName != nil {
159+
crossConnect["oci_physical_device_name"] = *r.OciPhysicalDeviceName
160+
}
161+
154162
if r.PortName != nil {
155163
crossConnect["port_name"] = *r.PortName
156164
}

internal/service/core/core_instance_resource.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,6 +1223,11 @@ func (s *CoreInstanceResourceCrud) Delete() error {
12231223
request.PreserveBootVolume = &tmp
12241224
}
12251225

1226+
if preserveDataVolumes, ok := s.D.GetOkExists("preserve_data_volumes"); ok {
1227+
tmp := preserveDataVolumes.(bool)
1228+
request.PreserveDataVolumes = &tmp
1229+
}
1230+
12261231
request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "core")
12271232

12281233
_, err := s.Client.TerminateInstance(context.Background(), request)

website/docs/d/core_boot_volume.html.markdown

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The following arguments are supported:
3232

3333
The following attributes are exported:
3434

35-
* `auto_tuned_vpus_per_gb` - The number of Volume Performance Units per GB that this boot volume is effectively tuned to when it's idle.
35+
* `auto_tuned_vpus_per_gb` - The number of Volume Performance Units per GB that this boot volume is effectively tuned to.
3636
* `availability_domain` - The availability domain of the boot volume. Example: `Uocm:PHX-AD-1`
3737
* `boot_volume_replicas` - The list of boot volume replicas of this boot volume
3838
* `availability_domain` - The availability domain of the boot volume replica. Example: `Uocm:PHX-AD-1`
@@ -44,7 +44,7 @@ The following attributes are exported:
4444
* `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}`
4545
* `id` - The boot volume's Oracle ID (OCID).
4646
* `image_id` - The image OCID used to create the boot volume.
47-
* `is_auto_tune_enabled` - Specifies whether the auto-tune performance is enabled for this boot volume.
47+
* `is_auto_tune_enabled` - Specifies whether the auto-tune performance is enabled for this boot volume. This field is deprecated. Use the `DetachedVolumeAutotunePolicy` instead to enable the volume for detached autotune.
4848
* `is_hydrated` - Specifies whether the boot volume's data has finished copying from the source boot volume or boot volume backup.
4949
* `kms_key_id` - The OCID of the Key Management master encryption key assigned to the boot volume.
5050
* `size_in_gbs` - The size of the boot volume in GBs.
@@ -60,5 +60,7 @@ The following attributes are exported:
6060

6161
Allowed values:
6262
* `10`: Represents Balanced option.
63-
* `20`: Represents Higher Performance option.
63+
* `20`: Represents Higher Performance option.
64+
65+
For performance autotune enabled volumes, It would be the Default(Minimum) VPUs/GB.
6466

website/docs/d/core_boot_volume_attachments.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The following attributes are exported:
5656
* `encryption_in_transit_type` - Refer the top-level definition of encryptionInTransitType. The default value is NONE.
5757
* `id` - The OCID of the boot volume attachment.
5858
* `instance_id` - The OCID of the instance the boot volume is attached to.
59-
* `is_pv_encryption_in_transit_enabled` - Whether in-transit encryption for the boot volume's paravirtualized attachment is enabled or not.
59+
* `is_pv_encryption_in_transit_enabled` - Whether in-transit encryption for the boot volume's paravirtualized attachment is enabled or not.
6060
* `state` - The current state of the boot volume attachment.
6161
* `time_created` - The date and time the boot volume was created, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z`
6262

0 commit comments

Comments
 (0)