Skip to content

Commit 77b7a5b

Browse files
authored
Release 3.51.0
Release 3.51.0
2 parents 1257d7a + d84b579 commit 77b7a5b

File tree

919 files changed

+15480
-840
lines changed

Some content is hidden

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

919 files changed

+15480
-840
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
## 3.50.1 (Unreleased)
1+
## 3.51.0 (Unreleased)
2+
3+
### Added
4+
- Support for updating `assign_public_ip` attribute in `oci_core_instance` resource
5+
- Support for Oracle Analytics cloud
6+
- Support for Oracle Integration cloud
7+
- Support for IKE version selections for IPSec connection in VPN
8+
- Support for `operating_system` and `operating_system_version` attributes in `oci_core_image` resource's `image_source_details`
9+
- Resource Manager data sources
10+
11+
### Fixed
12+
- Fixed `auto_backup_window` attribute in `database_db_system` and `database_db_home` resources
13+
214
## 3.50.0 (October 30, 2019)
315

416
### Added

examples/analytics/main.tf

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// These variables would commonly be defined as environment variables or sourced in a .env file
2+
variable "tenancy_ocid" {}
3+
4+
variable "user_ocid" {}
5+
variable "fingerprint" {}
6+
variable "private_key_path" {}
7+
variable "compartment_ocid" {}
8+
variable "region" {}
9+
10+
variable "email_notification" {}
11+
12+
variable "idcs_access_token" {}
13+
14+
provider "oci" {
15+
region = "${var.region}"
16+
tenancy_ocid = "${var.tenancy_ocid}"
17+
user_ocid = "${var.user_ocid}"
18+
fingerprint = "${var.fingerprint}"
19+
private_key_path = "${var.private_key_path}"
20+
}
21+
22+
resource "oci_analytics_analytics_instance" "test_oce_instance" {
23+
compartment_id = "${var.compartment_ocid}"
24+
description = "OAC instance"
25+
email_notification = "${var.email_notification}"
26+
feature_set = "ENTERPRISE_ANALYTICS"
27+
license_type = "LICENSE_INCLUDED"
28+
29+
capacity {
30+
capacity_type = "OLPU_COUNT"
31+
capacity_value = 2
32+
}
33+
34+
name = "testoacinstance"
35+
freeform_tags = "${map("freeformkey", "freeformvalue")}"
36+
state = "ACTIVE"
37+
idcs_access_token = "${var.idcs_access_token}"
38+
}
39+
40+
data "oci_analytics_analytics_instances" "test_instance" {
41+
compartment_id = "${var.compartment_ocid}"
42+
}
43+
44+
output "test" {
45+
value = "${data.oci_analytics_analytics_instances.test_instance.analytics_instances.*.id}"
46+
}

examples/integration/main.tf

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
2+
3+
variable "tenancy_ocid" {}
4+
variable "user_ocid" {}
5+
variable "fingerprint" {}
6+
variable "private_key_path" {}
7+
variable "region" {}
8+
variable "compartment_id" {}
9+
10+
variable "integration_instance_idcs_access_token" {
11+
default = "idcsAt"
12+
}
13+
14+
provider "oci" {
15+
tenancy_ocid = "${var.tenancy_ocid}"
16+
user_ocid = "${var.user_ocid}"
17+
fingerprint = "${var.fingerprint}"
18+
private_key_path = "${var.private_key_path}"
19+
region = "${var.region}"
20+
}
21+
22+
resource "oci_integration_integration_instance" "test_integration_instance" {
23+
#Required
24+
compartment_id = "${var.compartment_id}"
25+
display_name = "displayName"
26+
integration_instance_type = "STANDARD"
27+
is_byol = "false"
28+
message_packs = "10"
29+
30+
#Optional
31+
freeform_tags = {
32+
"bar-key" = "value"
33+
}
34+
35+
idcs_at = "${var.integration_instance_idcs_access_token}"
36+
}
37+
38+
data "oci_integration_integration_instances" "test_integration_instances" {
39+
#Required
40+
compartment_id = "${var.compartment_id}"
41+
42+
#Optional
43+
display_name = "displayName"
44+
state = "ACTIVE"
45+
}

examples/limits/quota.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ provider "oci" {
2121
resource "oci_limits_quota" "test_quota" {
2222
#Required
2323
compartment_id = "${var.tenancy_ocid}"
24-
description = "Quotas for compute resources"
24+
description = "Quotas for notifications"
2525
name = "TestQuotas"
26-
statements = ["Set compute quotas to 0 in tenancy"]
26+
statements = ["Set notifications quota topic-count to 99 in tenancy"]
2727

2828
#Optional
2929
defined_tags = "${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}"

examples/resourcemanager/main.tf

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
// Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
2+
3+
// This example shows how to use Resource Manager data sources with the (local) `terraform_remote_state` data source
4+
// so that output values from a different Resource Manager Stack can be referenced in this config.
5+
6+
variable "tenancy_ocid" {}
7+
variable "user_ocid" {}
8+
variable "fingerprint" {}
9+
variable "private_key_path" {}
10+
variable "region" {}
11+
variable "compartment_id" {}
12+
13+
provider "oci" {
14+
tenancy_ocid = "${var.tenancy_ocid}"
15+
user_ocid = "${var.user_ocid}"
16+
fingerprint = "${var.fingerprint}"
17+
private_key_path = "${var.private_key_path}"
18+
region = "${var.region}"
19+
}
20+
21+
data "oci_resourcemanager_stacks" "stack_list" {
22+
compartment_id = "${var.compartment_id}"
23+
state = "ACTIVE"
24+
}
25+
26+
output "print-stacks" {
27+
value = ["${data.oci_resourcemanager_stacks.stack_list.stacks}"]
28+
}
29+
30+
data "oci_resourcemanager_stack" "stack1" {
31+
stack_id = "${data.oci_resourcemanager_stacks.stack_list.stacks[0].id}"
32+
}
33+
34+
output "print-stack1" {
35+
value = {
36+
id = "${data.oci_resourcemanager_stack.stack1.stack_id}"
37+
compartment_id = "${data.oci_resourcemanager_stack.stack1.compartment_id}"
38+
display_name = "${data.oci_resourcemanager_stack.stack1.display_name}"
39+
state = "${data.oci_resourcemanager_stack.stack1.state}"
40+
}
41+
}
42+
43+
// pull the statefile of a Resource Manager stack into this context
44+
data "oci_resourcemanager_stack_tf_state" "stack1_tf_state" {
45+
stack_id = "${data.oci_resourcemanager_stack.stack1.stack_id}"
46+
local_path = "stack1.tfstate"
47+
}
48+
49+
output "print-tf-state" {
50+
value = {
51+
stack_id = "${data.oci_resourcemanager_stack_tf_state.stack1_tf_state.stack_id}"
52+
local_path = "${data.oci_resourcemanager_stack_tf_state.stack1_tf_state.local_path}"
53+
}
54+
}
55+
56+
// load that statefile into a remote state data source
57+
data "terraform_remote_state" "external_stack_remote_state" {
58+
backend = "local"
59+
60+
config = {
61+
path = "${data.oci_resourcemanager_stack_tf_state.stack1_tf_state.local_path}"
62+
}
63+
}
64+
65+
// example of referencing an output value `subnet_id` from the remote state data source
66+
//data "oci_core_subnet" "subnet1" {
67+
// subnet_id = "${data.terraform_remote_state.external_stack_remote_state.outputs.subnet_id}"
68+
//}
69+
70+
71+
//output print-subnet {
72+
// value = ["${data.oci_core_subnet.subnet1}"]
73+
//}
74+

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/hcl v0.0.0-20180404174102-ef8a98b0bbce
77
github.com/hashicorp/terraform v0.12.4-0.20190628193153-a74738cd35fc
88
github.com/mitchellh/cli v1.0.0
9-
github.com/oracle/oci-go-sdk v12.2.0+incompatible
9+
github.com/oracle/oci-go-sdk v12.3.0+incompatible
1010
github.com/stretchr/objx v0.1.1 // indirect
1111
github.com/stretchr/testify v1.3.0
1212
gopkg.in/yaml.v2 v2.2.2

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ github.com/oracle/oci-go-sdk v12.1.0+incompatible h1:I5VSXSg3wAhUo8dtbyauQM8kZGM
347347
github.com/oracle/oci-go-sdk v12.1.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
348348
github.com/oracle/oci-go-sdk v12.2.0+incompatible h1:z5FqDVTRHSYzR9td6FdQpFw2M3MGyPLSUPaBRlzjBco=
349349
github.com/oracle/oci-go-sdk v12.2.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
350+
github.com/oracle/oci-go-sdk v12.3.0+incompatible h1:hkX0CRD+OmK3+wCbKItck+zgqD+AiPcfxBXnmdgZPlA=
351+
github.com/oracle/oci-go-sdk v12.3.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
350352
github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58 h1:m3CEgv3ah1Rhy82L+c0QG/U3VyY1UsvsIdkh0/rU97Y=
351353
github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk=
352354
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func main() {
3838
log.Println("Executable runs in Terraform plugin mode by default. For additional usage options, please run with the '-help' flag.")
3939
plugin.Serve(&plugin.ServeOpts{
4040
ProviderFunc: func() terraform.ResourceProvider {
41-
return provider.Provider(provider.ProviderConfig)
41+
return provider.Provider()
4242
},
4343
})
4444
} else {
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
// Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
2+
3+
package oci
4+
5+
import (
6+
"context"
7+
8+
"github.com/hashicorp/terraform/helper/schema"
9+
oci_analytics "github.com/oracle/oci-go-sdk/analytics"
10+
)
11+
12+
func AnalyticsAnalyticsInstanceDataSource() *schema.Resource {
13+
fieldMap := make(map[string]*schema.Schema)
14+
fieldMap["analytics_instance_id"] = &schema.Schema{
15+
Type: schema.TypeString,
16+
Required: true,
17+
}
18+
return GetSingularDataSourceItemSchema(AnalyticsAnalyticsInstanceResource(), fieldMap, readSingularAnalyticsAnalyticsInstance)
19+
}
20+
21+
func readSingularAnalyticsAnalyticsInstance(d *schema.ResourceData, m interface{}) error {
22+
sync := &AnalyticsAnalyticsInstanceDataSourceCrud{}
23+
sync.D = d
24+
sync.Client = m.(*OracleClients).analyticsClient
25+
26+
return ReadResource(sync)
27+
}
28+
29+
type AnalyticsAnalyticsInstanceDataSourceCrud struct {
30+
D *schema.ResourceData
31+
Client *oci_analytics.AnalyticsClient
32+
Res *oci_analytics.GetAnalyticsInstanceResponse
33+
}
34+
35+
func (s *AnalyticsAnalyticsInstanceDataSourceCrud) VoidState() {
36+
s.D.SetId("")
37+
}
38+
39+
func (s *AnalyticsAnalyticsInstanceDataSourceCrud) Get() error {
40+
request := oci_analytics.GetAnalyticsInstanceRequest{}
41+
42+
if analyticsInstanceId, ok := s.D.GetOkExists("analytics_instance_id"); ok {
43+
tmp := analyticsInstanceId.(string)
44+
request.AnalyticsInstanceId = &tmp
45+
}
46+
47+
request.RequestMetadata.RetryPolicy = getRetryPolicy(false, "analytics")
48+
49+
response, err := s.Client.GetAnalyticsInstance(context.Background(), request)
50+
if err != nil {
51+
return err
52+
}
53+
54+
s.Res = &response
55+
return nil
56+
}
57+
58+
func (s *AnalyticsAnalyticsInstanceDataSourceCrud) SetData() error {
59+
if s.Res == nil {
60+
return nil
61+
}
62+
63+
s.D.SetId(*s.Res.Id)
64+
65+
if s.Res.Capacity != nil {
66+
s.D.Set("capacity", []interface{}{AnalyticsCapacityToMap(s.Res.Capacity)})
67+
} else {
68+
s.D.Set("capacity", nil)
69+
}
70+
71+
if s.Res.CompartmentId != nil {
72+
s.D.Set("compartment_id", *s.Res.CompartmentId)
73+
}
74+
75+
if s.Res.DefinedTags != nil {
76+
s.D.Set("defined_tags", definedTagsToMap(s.Res.DefinedTags))
77+
}
78+
79+
if s.Res.Description != nil {
80+
s.D.Set("description", *s.Res.Description)
81+
}
82+
83+
if s.Res.EmailNotification != nil {
84+
s.D.Set("email_notification", *s.Res.EmailNotification)
85+
}
86+
87+
s.D.Set("feature_set", s.Res.FeatureSet)
88+
89+
s.D.Set("freeform_tags", s.Res.FreeformTags)
90+
91+
s.D.Set("license_type", s.Res.LicenseType)
92+
93+
if s.Res.Name != nil {
94+
s.D.Set("name", *s.Res.Name)
95+
}
96+
97+
if s.Res.ServiceUrl != nil {
98+
s.D.Set("service_url", *s.Res.ServiceUrl)
99+
}
100+
101+
s.D.Set("state", s.Res.LifecycleState)
102+
103+
if s.Res.TimeCreated != nil {
104+
s.D.Set("time_created", s.Res.TimeCreated.String())
105+
}
106+
107+
if s.Res.TimeUpdated != nil {
108+
s.D.Set("time_updated", s.Res.TimeUpdated.String())
109+
}
110+
111+
return nil
112+
}

0 commit comments

Comments
 (0)