|
|
|
|
@ -17,6 +17,9 @@ func TestResource_basic(t *testing.T) {
|
|
|
|
|
Config: strings.TrimSpace(`
|
|
|
|
|
resource "test_resource" "foo" {
|
|
|
|
|
required = "yep"
|
|
|
|
|
required_map = {
|
|
|
|
|
key = "value"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
`),
|
|
|
|
|
Check: func(s *terraform.State) error {
|
|
|
|
|
@ -36,10 +39,13 @@ func TestResource_ignoreChangesRequired(t *testing.T) {
|
|
|
|
|
resource.TestStep{
|
|
|
|
|
Config: strings.TrimSpace(`
|
|
|
|
|
resource "test_resource" "foo" {
|
|
|
|
|
required = "yep"
|
|
|
|
|
lifecycle {
|
|
|
|
|
ignore_changes = ["required"]
|
|
|
|
|
}
|
|
|
|
|
required = "yep"
|
|
|
|
|
required_map = {
|
|
|
|
|
key = "value"
|
|
|
|
|
}
|
|
|
|
|
lifecycle {
|
|
|
|
|
ignore_changes = ["required"]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
`),
|
|
|
|
|
Check: func(s *terraform.State) error {
|
|
|
|
|
@ -59,6 +65,9 @@ func TestResource_ignoreChangesEmpty(t *testing.T) {
|
|
|
|
|
Config: strings.TrimSpace(`
|
|
|
|
|
resource "test_resource" "foo" {
|
|
|
|
|
required = "yep"
|
|
|
|
|
required_map = {
|
|
|
|
|
key = "value"
|
|
|
|
|
}
|
|
|
|
|
optional_force_new = "one"
|
|
|
|
|
lifecycle {
|
|
|
|
|
ignore_changes = []
|
|
|
|
|
@ -73,6 +82,9 @@ resource "test_resource" "foo" {
|
|
|
|
|
Config: strings.TrimSpace(`
|
|
|
|
|
resource "test_resource" "foo" {
|
|
|
|
|
required = "yep"
|
|
|
|
|
required_map = {
|
|
|
|
|
key = "value"
|
|
|
|
|
}
|
|
|
|
|
optional_force_new = "two"
|
|
|
|
|
lifecycle {
|
|
|
|
|
ignore_changes = []
|
|
|
|
|
@ -96,6 +108,9 @@ func TestResource_ignoreChangesForceNew(t *testing.T) {
|
|
|
|
|
Config: strings.TrimSpace(`
|
|
|
|
|
resource "test_resource" "foo" {
|
|
|
|
|
required = "yep"
|
|
|
|
|
required_map = {
|
|
|
|
|
key = "value"
|
|
|
|
|
}
|
|
|
|
|
optional_force_new = "one"
|
|
|
|
|
lifecycle {
|
|
|
|
|
ignore_changes = ["optional_force_new"]
|
|
|
|
|
@ -110,6 +125,9 @@ resource "test_resource" "foo" {
|
|
|
|
|
Config: strings.TrimSpace(`
|
|
|
|
|
resource "test_resource" "foo" {
|
|
|
|
|
required = "yep"
|
|
|
|
|
required_map = {
|
|
|
|
|
key = "value"
|
|
|
|
|
}
|
|
|
|
|
optional_force_new = "two"
|
|
|
|
|
lifecycle {
|
|
|
|
|
ignore_changes = ["optional_force_new"]
|
|
|
|
|
@ -135,6 +153,9 @@ func TestResource_ignoreChangesForceNewBoolean(t *testing.T) {
|
|
|
|
|
Config: strings.TrimSpace(`
|
|
|
|
|
resource "test_resource" "foo" {
|
|
|
|
|
required = "yep"
|
|
|
|
|
required_map = {
|
|
|
|
|
key = "value"
|
|
|
|
|
}
|
|
|
|
|
optional_force_new = "one"
|
|
|
|
|
optional_bool = true
|
|
|
|
|
lifecycle {
|
|
|
|
|
@ -150,6 +171,9 @@ resource "test_resource" "foo" {
|
|
|
|
|
Config: strings.TrimSpace(`
|
|
|
|
|
resource "test_resource" "foo" {
|
|
|
|
|
required = "yep"
|
|
|
|
|
required_map = {
|
|
|
|
|
key = "value"
|
|
|
|
|
}
|
|
|
|
|
optional_force_new = "two"
|
|
|
|
|
optional_bool = true
|
|
|
|
|
lifecycle {
|
|
|
|
|
@ -174,6 +198,9 @@ func TestResource_ignoreChangesMap(t *testing.T) {
|
|
|
|
|
Config: strings.TrimSpace(`
|
|
|
|
|
resource "test_resource" "foo" {
|
|
|
|
|
required = "yep"
|
|
|
|
|
required_map = {
|
|
|
|
|
key = "value"
|
|
|
|
|
}
|
|
|
|
|
optional_computed_map {
|
|
|
|
|
foo = "bar"
|
|
|
|
|
}
|
|
|
|
|
@ -190,6 +217,9 @@ resource "test_resource" "foo" {
|
|
|
|
|
Config: strings.TrimSpace(`
|
|
|
|
|
resource "test_resource" "foo" {
|
|
|
|
|
required = "yep"
|
|
|
|
|
required_map = {
|
|
|
|
|
key = "value"
|
|
|
|
|
}
|
|
|
|
|
optional_computed_map {
|
|
|
|
|
foo = "bar"
|
|
|
|
|
no = "update"
|
|
|
|
|
|