Skip to content

Commit dbb3d83

Browse files
Releasing version 4.15.0
Releasing version 4.15.0
2 parents 97ca374 + fe2e962 commit dbb3d83

File tree

447 files changed

+8416
-940
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

447 files changed

+8416
-940
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 4.15.0 (Unreleased)
2+
3+
### Added
4+
- Support for New compute shape E4-Dense
5+
- Support for Cloud Advisor Fix It actions for V1 recommendations
6+
- Support for Cloud Advisor customization at resource/compartment level
7+
- Support for `artifacts` service
8+
19
## 4.14.0 (February 17, 2021)
210

311
### Added
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (c) 2017, 2021, 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+
10+
variable "is_repository_created_on_first_push" {
11+
default = true
12+
}
13+
14+
15+
16+
provider "oci" {
17+
tenancy_ocid = var.tenancy_ocid
18+
user_ocid = var.user_ocid
19+
fingerprint = var.fingerprint
20+
private_key_path = var.private_key_path
21+
region = var.region
22+
}
23+
24+
resource "oci_artifacts_container_configuration" "test_container_configuration" {
25+
#Required
26+
compartment_id = var.tenancy_ocid
27+
is_repository_created_on_first_push = var.is_repository_created_on_first_push
28+
}
29+
30+
data "oci_artifacts_container_configuration" "test_container_configuration" {
31+
#Required
32+
compartment_id = var.tenancy_ocid
33+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
// Copyright (c) 2017, 2021, 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_ocid" {}
10+
11+
variable "container_repository_compartment_id_in_subtree" {
12+
default = false
13+
}
14+
15+
variable "container_repository_is_immutable" {
16+
default = false
17+
}
18+
19+
variable "container_repository_is_public" {
20+
default = false
21+
}
22+
23+
variable "container_repository_readme_content" {
24+
default = "content"
25+
}
26+
27+
variable "container_repository_readme_format" {
28+
default = "TEXT_MARKDOWN"
29+
}
30+
31+
variable "container_repository_state" {
32+
default = "AVAILABLE"
33+
}
34+
35+
36+
37+
provider "oci" {
38+
tenancy_ocid = var.tenancy_ocid
39+
user_ocid = var.user_ocid
40+
fingerprint = var.fingerprint
41+
private_key_path = var.private_key_path
42+
region = var.region
43+
}
44+
45+
// repository displayName needs to be unique within a tenant, so generate random string here to avoid collision
46+
resource "random_string" "container_repository_display_name" {
47+
length = 5
48+
number = false
49+
special = false
50+
upper = false
51+
}
52+
53+
resource "oci_artifacts_container_repository" "test_container_repository" {
54+
#Required
55+
compartment_id = var.compartment_ocid
56+
display_name = random_string.container_repository_display_name.result
57+
58+
#Optional
59+
is_immutable = var.container_repository_is_immutable
60+
is_public = var.container_repository_is_public
61+
readme {
62+
#Required
63+
content = var.container_repository_readme_content
64+
format = var.container_repository_readme_format
65+
}
66+
}
67+
68+
data "oci_artifacts_container_repositories" "test_container_repositories" {
69+
#Required
70+
compartment_id = var.compartment_ocid
71+
72+
#Optional
73+
compartment_id_in_subtree = var.container_repository_compartment_id_in_subtree
74+
is_public = var.container_repository_is_public
75+
repository_id = oci_artifacts_container_repository.test_container_repository.id
76+
state = var.container_repository_state
77+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
# Defines the number of instances to deploy
5+
variable "num_platform_config_instances" {
6+
default = "1"
7+
}
8+
9+
variable "platform_config_instance_shape" {
10+
default = "BM.DenseIO.E4.128"
11+
}
12+
13+
variable "instance_platform_config_numa_nodes_per_socket" {
14+
default = "NPS1"
15+
}
16+
17+
variable "instance_platform_config_type" {
18+
default = "AMD_MILAN_BM"
19+
}
20+
21+
resource "oci_core_instance" "test_instance_with_platform_config" {
22+
count = var.num_platform_config_instances
23+
availability_domain = data.oci_identity_availability_domain.ad.name
24+
compartment_id = var.compartment_ocid
25+
display_name = "TestInstance${count.index}"
26+
shape = var.platform_config_instance_shape
27+
28+
29+
platform_config {
30+
type = "${var.instance_platform_config_type}"
31+
numa_nodes_per_socket = "${var.instance_platform_config_numa_nodes_per_socket}"
32+
}
33+
34+
create_vnic_details {
35+
subnet_id = oci_core_subnet.test_subnet.id
36+
display_name = "Primaryvnic"
37+
assign_public_ip = true
38+
hostname_label = "tfexampleinstance${count.index}"
39+
}
40+
41+
source_details {
42+
source_type = "image"
43+
source_id = data.oci_core_images.supported_platform_config_shape_images.images[0]["id"]
44+
}
45+
46+
# Apply the following flag only if you wish to preserve the attached boot volume upon destroying this instance
47+
# Setting this and destroying the instance will result in a boot volume that should be managed outside of this config.
48+
# When changing this value, make sure to run 'terraform apply' so that it takes effect before the resource is destroyed.
49+
#preserve_boot_volume = true
50+
51+
metadata = {
52+
ssh_authorized_keys = var.ssh_public_key
53+
user_data = base64encode(file("./userdata/bootstrap"))
54+
}
55+
defined_tags = {
56+
"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag2.name}" = "awesome-app-server"
57+
}
58+
59+
freeform_tags = {
60+
"freeformkey${count.index}" = "freeformvalue${count.index}"
61+
}
62+
timeouts {
63+
create = "60m"
64+
}
65+
}
66+
67+
# Gets a list of all images that support a given Instance shape
68+
data "oci_core_images" "supported_platform_config_shape_images" {
69+
compartment_id = var.tenancy_ocid
70+
shape = var.platform_config_instance_shape
71+
operating_system = "Oracle Linux"
72+
73+
}
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
// Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
variable "instance_configuration_platform_config_instance_shape" {
5+
default = "BM.DenseIO.E4.128"
6+
}
7+
8+
variable "instance_configuration_platform_config_numa_nodes_per_socket" {
9+
default = "NPS1"
10+
}
11+
12+
variable "instance_configuration_platform_config_type" {
13+
default = "AMD_MILAN_BM"
14+
}
15+
16+
resource "oci_core_instance_configuration" "test_instance_configuration_platform_config" {
17+
compartment_id = var.compartment_ocid
18+
display_name = "TestInstanceConfigurationPlatformConfig"
19+
20+
instance_details {
21+
instance_type = "compute"
22+
23+
block_volumes {
24+
create_details {
25+
compartment_id = var.compartment_ocid
26+
display_name = "TestCreateVolumeDetails"
27+
availability_domain = data.oci_identity_availability_domain.ad.name
28+
size_in_gbs = 50
29+
vpus_per_gb = 2
30+
}
31+
32+
attach_details {
33+
type = "paravirtualized"
34+
display_name = "TestAttachVolumeDetails"
35+
is_read_only = true
36+
device = "TestDeviceName"
37+
is_pv_encryption_in_transit_enabled = true
38+
is_shareable = true
39+
}
40+
}
41+
42+
launch_details {
43+
compartment_id = var.compartment_ocid
44+
ipxe_script = "ipxeScript"
45+
shape = var.instance_configuration_platform_config_instance_shape
46+
display_name = "TestInstanceConfigurationPlatformConfigLaunchDetails"
47+
is_pv_encryption_in_transit_enabled = false
48+
preferred_maintenance_action = "LIVE_MIGRATE"
49+
launch_mode = "NATIVE"
50+
51+
agent_config {
52+
is_management_disabled = false
53+
is_monitoring_disabled = false
54+
}
55+
56+
launch_options {
57+
network_type = "PARAVIRTUALIZED"
58+
}
59+
60+
instance_options {
61+
are_legacy_imds_endpoints_disabled = false
62+
}
63+
64+
platform_config {
65+
type = var.instance_configuration_platform_config_type
66+
numa_nodes_per_socket = var.instance_configuration_platform_config_numa_nodes_per_socket
67+
}
68+
69+
create_vnic_details {
70+
assign_public_ip = true
71+
display_name = "TestInstanceConfigurationPlatformConfigVNIC"
72+
skip_source_dest_check = false
73+
}
74+
75+
extended_metadata = {
76+
some_string = "stringA"
77+
nested_object = "{\"some_string\": \"stringB\", \"object\": {\"some_string\": \"stringC\"}}"
78+
}
79+
80+
source_details {
81+
source_type = "image"
82+
image_id = data.oci_core_images.instance_config_supported_platform_config_shape_images.images[0]["id"]
83+
}
84+
}
85+
}
86+
}
87+
88+
# Gets a list of all images that support a given Instance shape
89+
data "oci_core_images" "instance_config_supported_platform_config_shape_images" {
90+
compartment_id = var.tenancy_ocid
91+
shape = var.instance_configuration_platform_config_instance_shape
92+
operating_system = "Oracle Linux"
93+
94+
}

examples/load_balancer/lb_full/lb_full.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ resource "oci_load_balancer_backend_set" "lb-bes1" {
317317
}
318318

319319
resource "oci_load_balancer_backend_set" "lb-bes2" {
320-
name = "lb-bes1"
320+
name = "lb-bes2"
321321
load_balancer_id = oci_load_balancer.lb2.id
322322
policy = "ROUND_ROBIN"
323323

@@ -445,8 +445,8 @@ resource "oci_load_balancer_backend" "lb-be1" {
445445
}
446446

447447
resource "oci_load_balancer_backend" "lb-be2" {
448-
load_balancer_id = oci_load_balancer.lb1.id
449-
backendset_name = oci_load_balancer_backend_set.lb-bes1.name
448+
load_balancer_id = oci_load_balancer.lb2.id
449+
backendset_name = oci_load_balancer_backend_set.lb-bes2.name
450450
ip_address = oci_core_instance.instance2.private_ip
451451
port = 80
452452
backup = false

examples/optimizer/main.tf

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ data "oci_optimizer_recommendations" "test_recommendations" {
4343
compartment_id = "${var.tenancy_ocid}"
4444
compartment_id_in_subtree = "true"
4545
filter {
46-
name = "importance"
47-
values = ["HIGH"]
46+
name = "name"
47+
values = ["cost-management-compute-host-underutilized-name"]
4848
}
4949
}
5050

@@ -63,8 +63,8 @@ data "oci_optimizer_resource_actions" "test_resource_actions" {
6363
compartment_id_in_subtree = "true"
6464
recommendation_id = "${oci_optimizer_recommendation.test_recommendation.recommendation_id}"
6565
filter {
66-
name = "name"
67-
values = ["inst-host-underutilized"]
66+
name = "status"
67+
values = ["PENDING", "DISMISSED", "POSTPONED"]
6868
}
6969
}
7070

@@ -99,15 +99,34 @@ resource "oci_identity_tag" "tag1" {
9999
}
100100

101101
resource "oci_optimizer_profile" "test_profile" {
102+
#Required
102103
compartment_id = "${var.tenancy_ocid}"
103104
description = "description"
104105
levels_configuration {
105106
items {
106-
level = "cost-compute_aggressive_average"
107-
recommendation_id = "${oci_optimizer_recommendation.test_recommendation.recommendation_id}"
107+
level = "cost-compute_standard_average"
108+
recommendation_id = "${data.oci_optimizer_recommendation.test_recommendation.recommendation_id}"
108109
}
109110
}
110111
name = "name"
112+
113+
#Optional
114+
target_compartments {
115+
#Required
116+
items = ["${var.compartment_ocid}"]
117+
}
118+
target_tags {
119+
#Required
120+
items {
121+
#Required
122+
tag_definition_name = "tagDefinitionName"
123+
tag_namespace_name = "tagNamespaceName"
124+
tag_value_type = "VALUE"
125+
126+
#Optional
127+
tag_values = ["tagValue"]
128+
}
129+
}
111130
}
112131

113132
data "oci_optimizer_profile" "test_profile" {
@@ -134,4 +153,14 @@ resource "oci_optimizer_enrollment_status" "test_enrollment_status" {
134153
data "oci_optimizer_histories" "test_histories" {
135154
compartment_id = "${var.tenancy_ocid}"
136155
compartment_id_in_subtree = "true"
156+
filter {
157+
name = "limit"
158+
values = [100]
159+
}
160+
}
161+
162+
data "oci_optimizer_recommendation_strategies" "test_recommendation_strategies" {
163+
#Required
164+
compartment_id = "${var.tenancy_ocid}"
165+
compartment_id_in_subtree = "true"
137166
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/hashicorp/hcl2 v0.0.0-20190618163856-0b64543c968c
77
github.com/hashicorp/terraform-exec v0.6.0
88
github.com/hashicorp/terraform-plugin-sdk v1.15.0
9-
github.com/oracle/oci-go-sdk/v35 v35.2.0
9+
github.com/oracle/oci-go-sdk/v35 v35.3.0
1010
github.com/stretchr/objx v0.1.1 // indirect
1111
github.com/stretchr/testify v1.6.1
1212
golang.org/x/mod v0.3.0

0 commit comments

Comments
 (0)