-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resource/aws_db_option_group: Add version field #2590
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -262,6 +262,44 @@ func TestAccAWSDBOptionGroup_sqlServerOptionsUpdate(t *testing.T) { | |
}) | ||
} | ||
|
||
func TestAccAWSDBOptionGroup_OracleOptionsUpdate(t *testing.T) { | ||
var v rds.OptionGroup | ||
rName := fmt.Sprintf("option-group-test-terraform-%s", acctest.RandString(5)) | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheck(t) }, | ||
Providers: testAccProviders, | ||
CheckDestroy: testAccCheckAWSDBOptionGroupDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccAWSDBOptionGroupOracleEEOptionSettings(rName), | ||
Check: resource.ComposeTestCheckFunc( | ||
testAccCheckAWSDBOptionGroupExists("aws_db_option_group.bar", &v), | ||
resource.TestCheckResourceAttr( | ||
"aws_db_option_group.bar", "name", rName), | ||
resource.TestCheckResourceAttr( | ||
"aws_db_option_group.bar", "option.#", "1"), | ||
resource.TestCheckResourceAttr( | ||
"aws_db_option_group.bar", "option.0.version", "12.1.0.4.v1"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As What I usually do is get the hash from the logs, using
This will put multiple log lines in the Note that the hash will change if parts of the |
||
), | ||
}, | ||
|
||
{ | ||
Config: testAccAWSDBOptionGroupOracleEEOptionSettings_update(rName), | ||
Check: resource.ComposeTestCheckFunc( | ||
testAccCheckAWSDBOptionGroupExists("aws_db_option_group.bar", &v), | ||
resource.TestCheckResourceAttr( | ||
"aws_db_option_group.bar", "name", rName), | ||
resource.TestCheckResourceAttr( | ||
"aws_db_option_group.bar", "option.#", "1"), | ||
resource.TestCheckResourceAttr( | ||
"aws_db_option_group.bar", "option.0.version", "12.1.0.5.v1"), | ||
), | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func TestAccAWSDBOptionGroup_multipleOptions(t *testing.T) { | ||
var v rds.OptionGroup | ||
rName := fmt.Sprintf("option-group-test-terraform-%s", acctest.RandString(5)) | ||
|
@@ -493,6 +531,84 @@ resource "aws_db_option_group" "bar" { | |
`, r) | ||
} | ||
|
||
func testAccAWSDBOptionGroupOracleEEOptionSettings(r string) string { | ||
return fmt.Sprintf(` | ||
resource "aws_security_group" "foo" { | ||
name = "terraform-test-issue_748" | ||
description = "SG for test of issue 748" | ||
} | ||
|
||
resource "aws_db_option_group" "bar" { | ||
name = "%s" | ||
option_group_description = "Test option group for terraform issue 748" | ||
engine_name = "oracle-ee" | ||
major_engine_version = "12.1" | ||
|
||
option { | ||
option_name = "OEM_AGENT" | ||
port = "3872" | ||
version = "12.1.0.4.v1" | ||
|
||
vpc_security_group_memberships = ["${aws_security_group.foo.id}"] | ||
|
||
option_settings { | ||
name = "OMS_PORT" | ||
value = "4903" | ||
} | ||
|
||
option_settings { | ||
name = "OMS_HOST" | ||
value = "oem.host.value" | ||
} | ||
|
||
option_settings { | ||
name = "AGENT_REGISTRATION_PASSWORD" | ||
value = "password" | ||
} | ||
} | ||
} | ||
`, r) | ||
} | ||
|
||
func testAccAWSDBOptionGroupOracleEEOptionSettings_update(r string) string { | ||
return fmt.Sprintf(` | ||
resource "aws_security_group" "foo" { | ||
name = "terraform-test-issue_748" | ||
description = "SG for test of issue 748" | ||
} | ||
|
||
resource "aws_db_option_group" "bar" { | ||
name = "%s" | ||
option_group_description = "Test option group for terraform issue 748" | ||
engine_name = "oracle-ee" | ||
major_engine_version = "12.1" | ||
|
||
option { | ||
option_name = "OEM_AGENT" | ||
port = "3872" | ||
version = "12.1.0.5.v1" | ||
|
||
vpc_security_group_memberships = ["${aws_security_group.foo.id}"] | ||
|
||
option_settings { | ||
name = "OMS_PORT" | ||
value = "4903" | ||
} | ||
|
||
option_settings { | ||
name = "OMS_HOST" | ||
value = "oem.host.value" | ||
} | ||
|
||
option_settings { | ||
name = "AGENT_REGISTRATION_PASSWORD" | ||
value = "password" | ||
} | ||
} | ||
} | ||
`, r) | ||
} | ||
|
||
func testAccAWSDBOptionGroupMultipleOptions(r string) string { | ||
return fmt.Sprintf(` | ||
resource "aws_db_option_group" "bar" { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this attribute be retrieved by the AWS API without a user setting it?
If so, this should also have a
Computed: true,
option