Skip to content

Commit 5e6970d

Browse files
Ameya Joshijotruon
authored andcommitted
Added - Support for Private Cloud at Customer
1 parent 5b00db0 commit 5e6970d

23 files changed

+3703
-0
lines changed
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
variable "tenancy_ocid" {}
5+
variable "user_ocid" {}
6+
variable "fingerprint" {}
7+
variable "private_key_path" {}
8+
variable "region" {}
9+
variable "compartment_id" {}
10+
11+
variable "ccc_infrastructure_access_level" {
12+
default = "RESTRICTED"
13+
}
14+
15+
variable "ccc_infrastructure_compartment_id_in_subtree" {
16+
default = false
17+
}
18+
19+
variable "ccc_infrastructure_connection_details" {
20+
default = "connectionDetails"
21+
}
22+
23+
variable "ccc_infrastructure_connection_state" {
24+
default = "REJECT"
25+
}
26+
27+
variable "ccc_infrastructure_defined_tags_value" {
28+
default = "value"
29+
}
30+
31+
variable "ccc_infrastructure_description" {
32+
default = "Datacenter 231"
33+
}
34+
35+
variable "ccc_infrastructure_display_name" {
36+
default = "example_cccInfrastructure"
37+
}
38+
39+
variable "ccc_infrastructure_display_name_contains" {
40+
default = "displayNameContains"
41+
}
42+
43+
variable "ccc_infrastructure_freeform_tags" {
44+
default = { "bar-key" = "value" }
45+
}
46+
47+
variable "ccc_infrastructure_state" {
48+
default = "ACTIVE"
49+
}
50+
51+
52+
53+
provider "oci" {
54+
tenancy_ocid = var.tenancy_ocid
55+
user_ocid = var.user_ocid
56+
fingerprint = var.fingerprint
57+
private_key_path = var.private_key_path
58+
region = var.region
59+
}
60+
61+
resource "oci_compute_cloud_at_customer_ccc_upgrade_schedule" "test_ccc_upgrade_schedule" {
62+
compartment_id = var.compartment_id
63+
display_name = "example_cccUpgradeSchedule"
64+
events {
65+
description = "description"
66+
schedule_event_duration = "PT49H"
67+
schedule_event_recurrences = "FREQ=MONTHLY;INTERVAL=3;"
68+
time_start = "2023-09-09T16:10:25Z"
69+
}
70+
}
71+
72+
resource "oci_core_vcn" "test_vcn" {
73+
cidr_block = "10.0.0.0/16"
74+
compartment_id = var.compartment_id
75+
lifecycle {
76+
ignore_changes = ["defined_tags"]
77+
}
78+
}
79+
80+
resource "oci_core_subnet" "test_subnet" {
81+
cidr_block = "10.0.0.0/24"
82+
compartment_id = var.compartment_id
83+
lifecycle {
84+
ignore_changes = ["defined_tags"]
85+
}
86+
vcn_id = oci_core_vcn.test_vcn.id
87+
}
88+
89+
variable defined_tag_namespace_name { default = "" }
90+
resource "oci_identity_tag_namespace" "tag-namespace1" {
91+
#Required
92+
compartment_id = var.compartment_id
93+
description = "example tag namespace"
94+
name = "${var.defined_tag_namespace_name != "" ? var.defined_tag_namespace_name : "example-tag-namespace-all"}"
95+
96+
is_retired = false
97+
lifecycle {
98+
ignore_changes = []
99+
}
100+
}
101+
102+
resource "oci_identity_tag" "tag1" {
103+
#Required
104+
description = "example tag"
105+
name = "example-tag"
106+
tag_namespace_id = oci_identity_tag_namespace.tag-namespace1.id
107+
108+
is_retired = false
109+
}
110+
111+
resource "oci_compute_cloud_at_customer_ccc_infrastructure" "test_ccc_infrastructure" {
112+
#Required
113+
compartment_id = var.compartment_id
114+
display_name = var.ccc_infrastructure_display_name
115+
subnet_id = oci_core_subnet.test_subnet.id
116+
117+
#Optional
118+
ccc_upgrade_schedule_id = oci_compute_cloud_at_customer_ccc_upgrade_schedule.test_ccc_upgrade_schedule.id
119+
connection_details = var.ccc_infrastructure_connection_details
120+
connection_state = var.ccc_infrastructure_connection_state
121+
defined_tags = map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", var.ccc_infrastructure_defined_tags_value)
122+
description = var.ccc_infrastructure_description
123+
freeform_tags = var.ccc_infrastructure_freeform_tags
124+
}
125+
126+
data "oci_compute_cloud_at_customer_ccc_infrastructures" "test_ccc_infrastructures" {
127+
128+
#Optional
129+
access_level = var.ccc_infrastructure_access_level
130+
ccc_infrastructure_id = oci_compute_cloud_at_customer_ccc_infrastructure.test_ccc_infrastructure.id
131+
compartment_id = var.compartment_id
132+
compartment_id_in_subtree = var.ccc_infrastructure_compartment_id_in_subtree
133+
display_name = var.ccc_infrastructure_display_name
134+
display_name_contains = var.ccc_infrastructure_display_name_contains
135+
state = var.ccc_infrastructure_state
136+
}
137+
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
variable "tenancy_ocid" {}
5+
variable "user_ocid" {}
6+
variable "fingerprint" {}
7+
variable "private_key_path" {}
8+
variable "region" {}
9+
variable "compartment_id" {}
10+
11+
variable "ccc_upgrade_schedule_access_level" {
12+
default = "RESTRICTED"
13+
}
14+
15+
variable "ccc_upgrade_schedule_compartment_id_in_subtree" {
16+
default = false
17+
}
18+
19+
variable "ccc_upgrade_schedule_defined_tags_value" {
20+
default = "value"
21+
}
22+
23+
variable "ccc_upgrade_schedule_description" {
24+
default = "Month-start upgrade window"
25+
}
26+
27+
variable "ccc_upgrade_schedule_display_name" {
28+
default = "example_cccUpgradeSchedule"
29+
}
30+
31+
variable "ccc_upgrade_schedule_display_name_contains" {
32+
default = "displayNameContains"
33+
}
34+
35+
variable "ccc_upgrade_schedule_events_description" {
36+
default = "Month-start upgrade window"
37+
}
38+
39+
variable "ccc_upgrade_schedule_events_schedule_event_duration" {
40+
default = "P2DT6H"
41+
}
42+
43+
variable "ccc_upgrade_schedule_events_schedule_event_recurrences" {
44+
default = "FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=1"
45+
}
46+
47+
variable "ccc_upgrade_schedule_events_time_start" {
48+
default = "2024-01-25T22:00:00Z"
49+
}
50+
51+
variable "ccc_upgrade_schedule_freeform_tags" {
52+
default = { "bar-key" = "value" }
53+
}
54+
55+
variable "ccc_upgrade_schedule_state" {
56+
default = "ACTIVE"
57+
}
58+
59+
60+
61+
provider "oci" {
62+
tenancy_ocid = var.tenancy_ocid
63+
user_ocid = var.user_ocid
64+
fingerprint = var.fingerprint
65+
private_key_path = var.private_key_path
66+
region = var.region
67+
}
68+
69+
variable defined_tag_namespace_name { default = "" }
70+
resource "oci_identity_tag_namespace" "tag-namespace1" {
71+
#Required
72+
compartment_id = var.compartment_id
73+
description = "example tag namespace"
74+
name = "${var.defined_tag_namespace_name != "" ? var.defined_tag_namespace_name : "example-tag-namespace-all"}"
75+
76+
is_retired = false
77+
}
78+
79+
resource "oci_identity_tag" "tag1" {
80+
#Required
81+
description = "example tag"
82+
name = "example-tag"
83+
tag_namespace_id = oci_identity_tag_namespace.tag-namespace1.id
84+
85+
is_retired = false
86+
}
87+
88+
resource "oci_compute_cloud_at_customer_ccc_upgrade_schedule" "test_ccc_upgrade_schedule" {
89+
#Required
90+
compartment_id = var.compartment_id
91+
display_name = var.ccc_upgrade_schedule_display_name
92+
events {
93+
#Required
94+
description = var.ccc_upgrade_schedule_events_description
95+
schedule_event_duration = var.ccc_upgrade_schedule_events_schedule_event_duration
96+
time_start = var.ccc_upgrade_schedule_events_time_start
97+
98+
#Optional
99+
schedule_event_recurrences = var.ccc_upgrade_schedule_events_schedule_event_recurrences
100+
}
101+
102+
#Optional
103+
defined_tags = map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", var.ccc_upgrade_schedule_defined_tags_value)
104+
description = var.ccc_upgrade_schedule_description
105+
freeform_tags = var.ccc_upgrade_schedule_freeform_tags
106+
}
107+
108+
data "oci_compute_cloud_at_customer_ccc_upgrade_schedules" "test_ccc_upgrade_schedules" {
109+
110+
#Optional
111+
access_level = var.ccc_upgrade_schedule_access_level
112+
ccc_upgrade_schedule_id = oci_compute_cloud_at_customer_ccc_upgrade_schedule.test_ccc_upgrade_schedule.id
113+
compartment_id = var.compartment_id
114+
compartment_id_in_subtree = var.ccc_upgrade_schedule_compartment_id_in_subtree
115+
display_name = var.ccc_upgrade_schedule_display_name
116+
display_name_contains = var.ccc_upgrade_schedule_display_name_contains
117+
state = var.ccc_upgrade_schedule_state
118+
}
119+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
package client
5+
6+
import (
7+
oci_compute_cloud_at_customer "github.com/oracle/oci-go-sdk/v65/computecloudatcustomer"
8+
9+
oci_common "github.com/oracle/oci-go-sdk/v65/common"
10+
)
11+
12+
func init() {
13+
RegisterOracleClient("oci_compute_cloud_at_customer.ComputeCloudAtCustomerClient", &OracleClient{InitClientFn: initComputecloudatcustomerComputeCloudAtCustomerClient})
14+
}
15+
16+
func initComputecloudatcustomerComputeCloudAtCustomerClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) {
17+
client, err := oci_compute_cloud_at_customer.NewComputeCloudAtCustomerClientWithConfigurationProvider(configProvider)
18+
if err != nil {
19+
return nil, err
20+
}
21+
err = configureClient(&client.BaseClient)
22+
if err != nil {
23+
return nil, err
24+
}
25+
26+
if serviceClientOverrides.HostUrlOverride != "" {
27+
client.Host = serviceClientOverrides.HostUrlOverride
28+
}
29+
return &client, nil
30+
}
31+
32+
func (m *OracleClients) ComputeCloudAtCustomerClient() *oci_compute_cloud_at_customer.ComputeCloudAtCustomerClient {
33+
return m.GetClient("oci_compute_cloud_at_customer.ComputeCloudAtCustomerClient").(*oci_compute_cloud_at_customer.ComputeCloudAtCustomerClient)
34+
}

0 commit comments

Comments
 (0)