Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ func (r *environmentBlueprintConfigurationResource) Schema(ctx context.Context,
CustomType: fwtypes.MapOfMapOfStringType,
Optional: true,
},
"global_parameters": schema.MapAttribute{
CustomType: fwtypes.MapOfStringType,
Optional: true,
},
},
}
}
Expand Down Expand Up @@ -240,4 +244,5 @@ type environmentBlueprintConfigurationResourceModel struct {
ManageAccessRoleARN fwtypes.ARN `tfsdk:"manage_access_role_arn"`
ProvisioningRoleARN fwtypes.ARN `tfsdk:"provisioning_role_arn"`
RegionalParameters fwtypes.MapOfMapOfString `tfsdk:"regional_parameters"`
GlobalParameters fwtypes.MapOfString `tfsdk:"global_parameters"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -431,3 +431,58 @@ resource "aws_datazone_environment_blueprint_configuration" "test" {
`, region, key, value),
)
}

func testAccEnvironmentBlueprintConfigurationConfig_global_parameters(domainName, key, value string) string {
return acctest.ConfigCompose(
testAccEnvironmentBlueprintDataSourceConfig_basic(domainName),
fmt.Sprintf(`
resource "aws_datazone_environment_blueprint_configuration" "test" {
domain_id = aws_datazone_domain.test.id
environment_blueprint_id = data.aws_datazone_environment_blueprint.test.id
enabled_regions = []

global_parameters = {
%[1]q = %[2]q
}
}
`, key, value),
)
}
func TestAccDataZoneEnvironmentBlueprintConfiguration_global_parameters(t *testing.T) {
ctx := acctest.Context(t)
var environmentblueprintconfiguration datazone.GetEnvironmentBlueprintConfigurationOutput
domainName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_datazone_environment_blueprint_configuration.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
acctest.PreCheck(ctx, t)
testAccPreCheck(ctx, t)
},
ErrorCheck: acctest.ErrorCheck(t, names.DataZoneServiceID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
CheckDestroy: testAccCheckEnvironmentBlueprintConfigurationDestroy(ctx),
Steps: []resource.TestStep{
{
Config: testAccEnvironmentBlueprintConfigurationConfig_global_parameters(
domainName,
"quickSightVPCConnectionRoleArn",
"arn:aws:iam::123456789012:role/example",
),
Check: resource.ComposeTestCheckFunc(
testAccCheckEnvironmentBlueprintConfigurationExists(ctx, resourceName, &environmentblueprintconfiguration),
resource.TestCheckResourceAttrSet(resourceName, "environment_blueprint_id"),
resource.TestCheckResourceAttr(resourceName, "global_parameters.%", "1"),
resource.TestCheckResourceAttr(resourceName, "global_parameters.quickSightVPCConnectionRoleArn", "arn:aws:iam::123456789012:role/example"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateIdFunc: testAccEnvironmentBlueprintConfigurationImportStateIdFunc(resourceName),
ImportStateVerifyIdentifierAttribute: "environment_blueprint_id",
},
},
})
}
Loading