From fab4ce2938f2fb399ebe58ca504596a0ecdc1a62 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 1 Aug 2018 13:18:43 -0700 Subject: [PATCH 01/42] Created happy path latest version Serverless Repo data source --- ...ce_aws_serverlessrepository_application.go | 72 +++++++++++++++++++ ...s_serverlessrepository_application_test.go | 48 +++++++++++++ aws/provider.go | 1 + 3 files changed, 121 insertions(+) create mode 100644 aws/data_source_aws_serverlessrepository_application.go create mode 100644 aws/data_source_aws_serverlessrepository_application_test.go diff --git a/aws/data_source_aws_serverlessrepository_application.go b/aws/data_source_aws_serverlessrepository_application.go new file mode 100644 index 00000000000..7d828c76fb9 --- /dev/null +++ b/aws/data_source_aws_serverlessrepository_application.go @@ -0,0 +1,72 @@ +package aws + +import ( + "fmt" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/serverlessapplicationrepository" + "github.com/hashicorp/terraform/helper/schema" + "log" +) + +func dataSourceAwsServerlessRepositoryApplication() *schema.Resource { + return &schema.Resource{ + Read: dataSourceAwsServerlessRepositoryApplicationRead, + + Schema: map[string]*schema.Schema{ + "application_id": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validateArn, + }, + "name": { + Type: schema.TypeString, + Computed: true, + }, + "semantic_version": { + Type: schema.TypeString, + Computed: true, + }, + "source_code_url": { + Type: schema.TypeString, + Computed: true, + }, + "template_url": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataSourceAwsServerlessRepositoryApplicationRead(d *schema.ResourceData, meta interface{}) error { + log.Print("[DEBUG] Let' go!") + conn := meta.(*AWSClient).serverlessapplicationrepositoryconn + + applicationID := d.Get("application_id").(string) + input := &serverlessapplicationrepository.GetApplicationInput{ + ApplicationId: aws.String(applicationID), + } + + log.Printf("[DEBUG] Reading Serverless Repository Application with request: %s", input) + + output, err := conn.GetApplication(input) + if err != nil { + return fmt.Errorf("error reading application: %s", err) + } + + d.SetId(applicationID) + if err := d.Set("name", output.Name); err != nil { + return err + } + if err := d.Set("semantic_version", output.Version.SemanticVersion); err != nil { + return err + } + if err := d.Set("source_code_url", output.Version.SourceCodeUrl); err != nil { + return err + } + if err := d.Set("template_url", output.Version.TemplateUrl); err != nil { + return err + } + + return nil +} diff --git a/aws/data_source_aws_serverlessrepository_application_test.go b/aws/data_source_aws_serverlessrepository_application_test.go new file mode 100644 index 00000000000..c87b798dc4e --- /dev/null +++ b/aws/data_source_aws_serverlessrepository_application_test.go @@ -0,0 +1,48 @@ +package aws + +import ( + "testing" + + "fmt" + "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform/terraform" +) + +func TestAccDataSourceAwsServerlessRepositoryApplication_Basic(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig, + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsServerlessRepositoryApplicationDataSourceID("data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator"), + resource.TestCheckResourceAttr("data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator", "name", "SecretsManagerRDSPostgreSQLRotationSingleUser"), + resource.TestCheckResourceAttrSet("data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator", "semantic_version"), + resource.TestCheckResourceAttrSet("data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator", "source_code_url"), + resource.TestCheckResourceAttrSet("data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator", "template_url"), + ), + }, + }, + }) +} + +func testAccCheckAwsServerlessRepositoryApplicationDataSourceID(n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Can't find Serverless Repository Application data source: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("AMI data source ID not set") + } + return nil + } +} + +const testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig = ` +data "aws_serverlessrepository_application" "secrets_manager_postgres_single_user_rotator" { + application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" +} +` diff --git a/aws/provider.go b/aws/provider.go index a2afc2a646c..461979ce5a4 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -256,6 +256,7 @@ func Provider() terraform.ResourceProvider { "aws_s3_bucket_objects": dataSourceAwsS3BucketObjects(), "aws_secretsmanager_secret": dataSourceAwsSecretsManagerSecret(), "aws_secretsmanager_secret_version": dataSourceAwsSecretsManagerSecretVersion(), + "aws_serverlessrepository_application": dataSourceAwsServerlessRepositoryApplication(), "aws_servicequotas_service": dataSourceAwsServiceQuotasService(), "aws_servicequotas_service_quota": dataSourceAwsServiceQuotasServiceQuota(), "aws_sns_topic": dataSourceAwsSnsTopic(), From 9d762ebd71baddb3d3070da818c21ef7c5220faa Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 1 Aug 2018 14:31:05 -0700 Subject: [PATCH 02/42] Handle non-existent applications in the repo --- ...rce_aws_serverlessrepository_application_test.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/aws/data_source_aws_serverlessrepository_application_test.go b/aws/data_source_aws_serverlessrepository_application_test.go index c87b798dc4e..1c15173e489 100644 --- a/aws/data_source_aws_serverlessrepository_application_test.go +++ b/aws/data_source_aws_serverlessrepository_application_test.go @@ -1,9 +1,10 @@ package aws import ( + "fmt" + "regexp" "testing" - "fmt" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) @@ -23,6 +24,10 @@ func TestAccDataSourceAwsServerlessRepositoryApplication_Basic(t *testing.T) { resource.TestCheckResourceAttrSet("data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator", "template_url"), ), }, + { + Config: testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_NonExistent, + ExpectError: regexp.MustCompile(`error reading application`), + }, }, }) } @@ -46,3 +51,9 @@ data "aws_serverlessrepository_application" "secrets_manager_postgres_single_use application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" } ` + +const testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_NonExistent = ` +data "aws_serverlessrepository_application" "no_such_function" { + application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/ThisFunctionDoesNotExist" +} +` From 294e1e8c441530abaedb7bcf03f60ce2417aff23 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 1 Aug 2018 15:41:27 -0700 Subject: [PATCH 03/42] Added version parameter for Serverless Application Repo application data source --- ...ce_aws_serverlessrepository_application.go | 15 +++++-- ...s_serverlessrepository_application_test.go | 39 +++++++++++++++++++ 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_serverlessrepository_application.go b/aws/data_source_aws_serverlessrepository_application.go index 7d828c76fb9..089f7fe8173 100644 --- a/aws/data_source_aws_serverlessrepository_application.go +++ b/aws/data_source_aws_serverlessrepository_application.go @@ -2,10 +2,11 @@ package aws import ( "fmt" + "log" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/serverlessapplicationrepository" "github.com/hashicorp/terraform/helper/schema" - "log" ) func dataSourceAwsServerlessRepositoryApplication() *schema.Resource { @@ -18,11 +19,12 @@ func dataSourceAwsServerlessRepositoryApplication() *schema.Resource { Required: true, ValidateFunc: validateArn, }, - "name": { + "semantic_version": { Type: schema.TypeString, + Optional: true, Computed: true, }, - "semantic_version": { + "name": { Type: schema.TypeString, Computed: true, }, @@ -43,11 +45,16 @@ func dataSourceAwsServerlessRepositoryApplicationRead(d *schema.ResourceData, me conn := meta.(*AWSClient).serverlessapplicationrepositoryconn applicationID := d.Get("application_id").(string) + input := &serverlessapplicationrepository.GetApplicationInput{ ApplicationId: aws.String(applicationID), } - log.Printf("[DEBUG] Reading Serverless Repository Application with request: %s", input) + if v, ok := d.GetOk("semantic_version"); ok { + version := v.(string) + input.SemanticVersion = aws.String(version) + } + log.Printf("[DEBUG] Reading Serverless Repo Application with request: %s", input) output, err := conn.GetApplication(input) if err != nil { diff --git a/aws/data_source_aws_serverlessrepository_application_test.go b/aws/data_source_aws_serverlessrepository_application_test.go index 1c15173e489..21edec9d1fc 100644 --- a/aws/data_source_aws_serverlessrepository_application_test.go +++ b/aws/data_source_aws_serverlessrepository_application_test.go @@ -31,6 +31,29 @@ func TestAccDataSourceAwsServerlessRepositoryApplication_Basic(t *testing.T) { }, }) } +func TestAccDataSourceAwsServerlessRepositoryApplication_Versioned(t *testing.T) { + const version = "1.0.15" + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_Versioned(version), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsServerlessRepositoryApplicationDataSourceID("data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator"), + resource.TestCheckResourceAttr("data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator", "name", "SecretsManagerRDSPostgreSQLRotationSingleUser"), + resource.TestCheckResourceAttr("data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator", "semantic_version", version), + resource.TestCheckResourceAttrSet("data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator", "source_code_url"), + resource.TestCheckResourceAttrSet("data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator", "template_url"), + ), + }, + { + Config: testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_Versioned_NonExistent, + ExpectError: regexp.MustCompile(`error reading application`), + }, + }, + }) +} func testAccCheckAwsServerlessRepositoryApplicationDataSourceID(n string) resource.TestCheckFunc { return func(s *terraform.State) error { @@ -57,3 +80,19 @@ data "aws_serverlessrepository_application" "no_such_function" { application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/ThisFunctionDoesNotExist" } ` + +func testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_Versioned(version string) string { + return fmt.Sprintf(` +data "aws_serverlessrepository_application" "secrets_manager_postgres_single_user_rotator" { + application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" + semantic_version = "%[1]s" +} +`, version) +} + +const testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_Versioned_NonExistent = ` +data "aws_serverlessrepository_application" "secrets_manager_postgres_single_user_rotator" { + application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" + semantic_version = "42.13.7" +} +` From b2cd9c37060da4e27754ac22eefa10a43d9d445d Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 1 Aug 2018 16:01:22 -0700 Subject: [PATCH 04/42] Added documentation --- .../serverlessrepo_application.html.markdown | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 website/docs/d/serverlessrepo_application.html.markdown diff --git a/website/docs/d/serverlessrepo_application.html.markdown b/website/docs/d/serverlessrepo_application.html.markdown new file mode 100644 index 00000000000..c0a60d09af6 --- /dev/null +++ b/website/docs/d/serverlessrepo_application.html.markdown @@ -0,0 +1,41 @@ +--- +layout: "aws" +page_title: "AWS: aws_serverlessrepo_application" +sidebar_current: "docs-aws-datasource-serverlessrepo-application" +description: |- + Get information on a AWS Serverless Application Repository application +--- + +# Data Source: aws_serverlessrepo_application + +Use this data source to get the source code URL and template URL of an AWS Serverless Application Repository application. + +## Example Usage + +```hcl +data "aws_serverlessrepo_application" "example" { + application_id = "arn:aws:serverlessrepo:us-east-1:123456789012:applications/ExampleApplication" +} + +resource "aws_cloudformation_stack" "example" { + name = "Example" + + capabilities = ["CAPABILITY_NAMED_IAM"] + + template_url = "${data.aws_serverlessrepo_application.example.template_url}" +} + +``` + +## Argument Reference + +* `application_id` - (Required) The ARN of the application. +* `semantic_version` - (Optional) The requested version of the application. By default, uses the latest version. + +## Attributes Reference + +* `application_id` - The ARN of the application. +* `semantic_version` - The version of the application retrieved. +* `name` - The name of the application. +* `source_code_url` - A URL pointing to the source code of the application version. +* `template_url` - A URL pointing to the Cloud Formation template for the application version. From 649d557e7a907901ad09938cd36fe6af8d54653a Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 6 Sep 2018 23:13:32 -0700 Subject: [PATCH 05/42] Added basic creation, reading, and deletion of a Serveless Repo Application --- ...ce_aws_serverlessrepository_application.go | 1 - aws/provider.go | 1 + ...resource_aws_serverlessrepo_application.go | 369 ++++++++++++++++++ ...rce_aws_serverlessrepo_application_test.go | 66 ++++ 4 files changed, 436 insertions(+), 1 deletion(-) create mode 100644 aws/resource_aws_serverlessrepo_application.go create mode 100644 aws/resource_aws_serverlessrepo_application_test.go diff --git a/aws/data_source_aws_serverlessrepository_application.go b/aws/data_source_aws_serverlessrepository_application.go index 089f7fe8173..0ffeadf162c 100644 --- a/aws/data_source_aws_serverlessrepository_application.go +++ b/aws/data_source_aws_serverlessrepository_application.go @@ -41,7 +41,6 @@ func dataSourceAwsServerlessRepositoryApplication() *schema.Resource { } func dataSourceAwsServerlessRepositoryApplicationRead(d *schema.ResourceData, meta interface{}) error { - log.Print("[DEBUG] Let' go!") conn := meta.(*AWSClient).serverlessapplicationrepositoryconn applicationID := d.Get("application_id").(string) diff --git a/aws/provider.go b/aws/provider.go index 461979ce5a4..c1bf0b911c2 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -701,6 +701,7 @@ func Provider() terraform.ResourceProvider { "aws_securityhub_account": resourceAwsSecurityHubAccount(), "aws_securityhub_product_subscription": resourceAwsSecurityHubProductSubscription(), "aws_securityhub_standards_subscription": resourceAwsSecurityHubStandardsSubscription(), + "aws_serverlessrepository_application": resourceAwsServerlessRepositoryApplication(), "aws_servicecatalog_portfolio": resourceAwsServiceCatalogPortfolio(), "aws_service_discovery_http_namespace": resourceAwsServiceDiscoveryHttpNamespace(), "aws_service_discovery_private_dns_namespace": resourceAwsServiceDiscoveryPrivateDnsNamespace(), diff --git a/aws/resource_aws_serverlessrepo_application.go b/aws/resource_aws_serverlessrepo_application.go new file mode 100644 index 00000000000..10fd25349e7 --- /dev/null +++ b/aws/resource_aws_serverlessrepo_application.go @@ -0,0 +1,369 @@ +package aws + +import ( + "fmt" + "log" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/service/cloudformation" + "github.com/aws/aws-sdk-go/service/serverlessapplicationrepository" + "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform/helper/schema" +) + +func resourceAwsServerlessRepositoryApplication() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsServerlessRepositoryApplicationCreate, + Read: resourceAwsServerlessRepositoryApplicationRead, + // Update: resourceAwsServerlessRepositoryApplicationUpdate, + Delete: resourceAwsServerlessRepositoryApplicationDelete, + + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(30 * time.Minute), + Update: schema.DefaultTimeout(30 * time.Minute), + Delete: schema.DefaultTimeout(30 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "application_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validateArn, + }, + "parameters": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + }, + // "semantic_version": { + // Type: schema.TypeString, + // Optional: true, + // Computed: true, + // }, + // "outputs": { + // Type: schema.TypeMap, + // Computed: true, + // }, + }, + } +} + +func resourceAwsServerlessRepositoryApplicationCreate(d *schema.ResourceData, meta interface{}) error { + serverlessConn := meta.(*AWSClient).serverlessapplicationrepositoryconn + cfConn := meta.(*AWSClient).cfconn + + changeSetRequest := serverlessapplicationrepository.CreateCloudFormationChangeSetRequest{ + StackName: aws.String(d.Get("name").(string)), + ApplicationId: aws.String(d.Get("application_id").(string)), + } + if v, ok := d.GetOk("parameters"); ok { + changeSetRequest.ParameterOverrides = expandServerlessRepositoryApplicationParameters(v.(map[string]interface{})) + } + + log.Printf("[DEBUG] Creating Serverless Repo Application Change Set: %s", changeSetRequest) + changeSetResponse, err := serverlessConn.CreateCloudFormationChangeSet(&changeSetRequest) + if err != nil { + return fmt.Errorf("Creating Serverless Repo Application Change Set failed: %s", err.Error()) + } + + d.SetId(*changeSetResponse.StackId) + + var lastChangeSetStatus string + changeSetWait := resource.StateChangeConf{ + Pending: []string{ + "CREATE_PENDING", + "CREATE_IN_PROGRESS", + }, + Target: []string{ + "CREATE_COMPLETE", + "DELETE_COMPLETE", + "FAILED", + }, + Timeout: d.Timeout(schema.TimeoutCreate), + MinTimeout: 1 * time.Second, + Refresh: func() (interface{}, string, error) { + resp, err := cfConn.DescribeChangeSet(&cloudformation.DescribeChangeSetInput{ + ChangeSetName: changeSetResponse.ChangeSetId, + }) + if err != nil { + log.Printf("[ERROR] Failed to describe Change Set: %s", err) + return nil, "", err + } + status := *resp.Status + lastChangeSetStatus = status + log.Printf("[DEBUG] Current CloudFormation stack status: %q", status) + + return resp, status, err + }, + } + _, err = changeSetWait.WaitForState() + if err != nil { + return err + } + + if lastChangeSetStatus == "FAILED" { + reasons, err := getCloudFormationFailures(d.Id(), cfConn) + if err != nil { + return fmt.Errorf("Failed getting failure reasons: %q", err.Error()) + } + return fmt.Errorf("%s: %q", lastChangeSetStatus, reasons) + } + + executeRequest := cloudformation.ExecuteChangeSetInput{ + ChangeSetName: changeSetResponse.ChangeSetId, + } + log.Printf("[DEBUG] Executing Change Set: %s", executeRequest) + _, err = cfConn.ExecuteChangeSet(&executeRequest) + if err != nil { + return fmt.Errorf("Executing Change Set failed: %s", err.Error()) + } + var lastStatus string + + wait := resource.StateChangeConf{ + Pending: []string{ + "CREATE_IN_PROGRESS", + "DELETE_IN_PROGRESS", + "ROLLBACK_IN_PROGRESS", + }, + Target: []string{ + "CREATE_COMPLETE", + "CREATE_FAILED", + "DELETE_COMPLETE", + "DELETE_FAILED", + "ROLLBACK_COMPLETE", + "ROLLBACK_FAILED", + }, + Timeout: d.Timeout(schema.TimeoutCreate), + MinTimeout: 1 * time.Second, + Refresh: func() (interface{}, string, error) { + resp, err := cfConn.DescribeStacks(&cloudformation.DescribeStacksInput{ + StackName: aws.String(d.Id()), + }) + if err != nil { + log.Printf("[ERROR] Failed to describe stacks: %s", err) + return nil, "", err + } + if len(resp.Stacks) == 0 { + // This shouldn't happen unless CloudFormation is inconsistent + // See https://github.com/hashicorp/terraform/issues/5487 + log.Printf("[WARN] CloudFormation stack %q not found.\nresponse: %q", + d.Id(), resp) + return resp, "", fmt.Errorf( + "CloudFormation stack %q vanished unexpectedly during creation.\n"+ + "Unless you knowingly manually deleted the stack "+ + "please report this as bug at https://github.com/hashicorp/terraform/issues\n"+ + "along with the config & Terraform version & the details below:\n"+ + "Full API response: %s\n", + d.Id(), resp) + } + + status := *resp.Stacks[0].StackStatus + lastStatus = status + log.Printf("[DEBUG] Current CloudFormation stack status: %q", status) + + return resp, status, err + }, + } + + _, err = wait.WaitForState() + if err != nil { + return err + } + + if lastStatus == "ROLLBACK_COMPLETE" || lastStatus == "ROLLBACK_FAILED" { + reasons, err := getCloudFormationRollbackReasons(d.Id(), nil, cfConn) + if err != nil { + return fmt.Errorf("Failed getting rollback reasons: %q", err.Error()) + } + + return fmt.Errorf("%s: %q", lastStatus, reasons) + } + if lastStatus == "DELETE_COMPLETE" || lastStatus == "DELETE_FAILED" { + reasons, err := getCloudFormationDeletionReasons(d.Id(), cfConn) + if err != nil { + return fmt.Errorf("Failed getting deletion reasons: %q", err.Error()) + } + + d.SetId("") + return fmt.Errorf("%s: %q", lastStatus, reasons) + } + if lastStatus == "CREATE_FAILED" { + reasons, err := getCloudFormationFailures(d.Id(), cfConn) + if err != nil { + return fmt.Errorf("Failed getting failure reasons: %q", err.Error()) + } + return fmt.Errorf("%s: %q", lastStatus, reasons) + } + + log.Printf("[INFO] CloudFormation Stack %q created", d.Id()) + + return resourceAwsServerlessRepositoryApplicationRead(d, meta) +} + +func resourceAwsServerlessRepositoryApplicationRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).cfconn + + input := &cloudformation.DescribeStacksInput{ + StackName: aws.String(d.Id()), + } + resp, err := conn.DescribeStacks(input) + if err != nil { + awsErr, ok := err.(awserr.Error) + // ValidationError: Stack with id % does not exist + if ok && awsErr.Code() == "ValidationError" { + log.Printf("[WARN] Removing CloudFormation stack %s as it's already gone", d.Id()) + d.SetId("") + return nil + } + + return err + } + + stacks := resp.Stacks + if len(stacks) < 1 { + log.Printf("[WARN] Removing CloudFormation stack %s as it's already gone", d.Id()) + d.SetId("") + return nil + } + for _, s := range stacks { + if *s.StackId == d.Id() && *s.StackStatus == "DELETE_COMPLETE" { + log.Printf("[DEBUG] Removing CloudFormation stack %s"+ + " as it has been already deleted", d.Id()) + d.SetId("") + return nil + } + } + + stack := stacks[0] + log.Printf("[DEBUG] Received CloudFormation stack: %s", stack) + + // Serverless Application Repo prefixes the stack with "serverlessrepo-", so remove it + stackName := strings.TrimPrefix(*stack.StackName, "serverlessrepo-") + d.Set("name", &stackName) + + originalParams := d.Get("parameters").(map[string]interface{}) + err = d.Set("parameters", flattenCloudFormationParameters(stack.Parameters, originalParams)) + if err != nil { + return err + } + + // err = d.Set("tags", flattenCloudFormationTags(stack.Tags)) + // if err != nil { + // return err + // } + + // err = d.Set("outputs", flattenCloudFormationOutputs(stack.Outputs)) + // if err != nil { + // return err + // } + + return nil +} +func resourceAwsServerlessRepositoryApplicationDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).cfconn + + input := &cloudformation.DeleteStackInput{ + StackName: aws.String(d.Id()), + } + log.Printf("[DEBUG] Deleting CloudFormation stack %s", input) + _, err := conn.DeleteStack(input) + if err != nil { + awsErr, ok := err.(awserr.Error) + if !ok { + return err + } + + if awsErr.Code() == "ValidationError" { + // Ignore stack which has been already deleted + return nil + } + return err + } + var lastStatus string + wait := resource.StateChangeConf{ + Pending: []string{ + "DELETE_IN_PROGRESS", + "ROLLBACK_IN_PROGRESS", + }, + Target: []string{ + "DELETE_COMPLETE", + "DELETE_FAILED", + }, + Timeout: d.Timeout(schema.TimeoutDelete), + MinTimeout: 5 * time.Second, + Refresh: func() (interface{}, string, error) { + resp, err := conn.DescribeStacks(&cloudformation.DescribeStacksInput{ + StackName: aws.String(d.Id()), + }) + if err != nil { + awsErr, ok := err.(awserr.Error) + if !ok { + return nil, "", err + } + + log.Printf("[DEBUG] Error when deleting CloudFormation stack: %s: %s", + awsErr.Code(), awsErr.Message()) + + // ValidationError: Stack with id % does not exist + if awsErr.Code() == "ValidationError" { + return resp, "DELETE_COMPLETE", nil + } + return nil, "", err + } + + if len(resp.Stacks) == 0 { + log.Printf("[DEBUG] CloudFormation stack %q is already gone", d.Id()) + return resp, "DELETE_COMPLETE", nil + } + + status := *resp.Stacks[0].StackStatus + lastStatus = status + log.Printf("[DEBUG] Current CloudFormation stack status: %q", status) + + return resp, status, err + }, + } + + _, err = wait.WaitForState() + if err != nil { + return err + } + + if lastStatus == "DELETE_FAILED" { + reasons, err := getCloudFormationFailures(d.Id(), conn) + if err != nil { + return fmt.Errorf("Failed getting reasons of failure: %q", err.Error()) + } + + return fmt.Errorf("%s: %q", lastStatus, reasons) + } + + log.Printf("[DEBUG] CloudFormation stack %q has been deleted", d.Id()) + + return nil +} + +// Move to `structure.go`? +func expandServerlessRepositoryApplicationParameters(params map[string]interface{}) []*serverlessapplicationrepository.ParameterValue { + var appParams []*serverlessapplicationrepository.ParameterValue + for k, v := range params { + appParams = append(appParams, &serverlessapplicationrepository.ParameterValue{ + Name: aws.String(k), + Value: aws.String(v.(string)), + }) + } + return appParams +} diff --git a/aws/resource_aws_serverlessrepo_application_test.go b/aws/resource_aws_serverlessrepo_application_test.go new file mode 100644 index 00000000000..b2d12d8525c --- /dev/null +++ b/aws/resource_aws_serverlessrepo_application_test.go @@ -0,0 +1,66 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/cloudformation" + "github.com/hashicorp/terraform/helper/acctest" + "github.com/hashicorp/terraform/helper/resource" + "github.com/hashicorp/terraform/terraform" +) + +func TestAccAwsServerlessRepositoryApplication_Basic(t *testing.T) { + var stack cloudformation.Stack + stackName := fmt.Sprintf("tf-acc-test-basic-%s", acctest.RandString(10)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSCloudFormationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsServerlessRepositoryApplicationConfig(stackName), + Check: resource.ComposeTestCheckFunc( + testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_application.postgres-rotator", &stack), + ), + }, + }, + }) +} + +func testAccAwsServerlessRepositoryApplicationConfig(stackName string) string { + return fmt.Sprintf(` +resource "aws_serverlessrepository_application" "postgres-rotator" { + name = "%[1]s" + application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" + parameters = { + functionName = "func-%[1]s" + endpoint = "secretsmanager.us-east-2.amazonaws.com" + } +}`, stackName) +} + +func testAccCheckerverlessRepositoryApplicationExists(n string, stack *cloudformation.Stack) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + conn := testAccProvider.Meta().(*AWSClient).cfconn + params := &cloudformation.DescribeStacksInput{ + StackName: aws.String(rs.Primary.ID), + } + resp, err := conn.DescribeStacks(params) + if err != nil { + return err + } + if len(resp.Stacks) == 0 { + return fmt.Errorf("CloudFormation stack not found") + } + + return nil + } +} From 13eedc6698206861ce249d106954eebc06ed671a Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 21 Sep 2018 17:50:23 -0700 Subject: [PATCH 06/42] Added version parameter as output and optional input --- ...resource_aws_serverlessrepo_application.go | 51 +++++++++++-------- ...rce_aws_serverlessrepo_application_test.go | 36 +++++++++++++ 2 files changed, 65 insertions(+), 22 deletions(-) diff --git a/aws/resource_aws_serverlessrepo_application.go b/aws/resource_aws_serverlessrepo_application.go index 10fd25349e7..bcb6f478bdc 100644 --- a/aws/resource_aws_serverlessrepo_application.go +++ b/aws/resource_aws_serverlessrepo_application.go @@ -48,15 +48,12 @@ func resourceAwsServerlessRepositoryApplication() *schema.Resource { Optional: true, Computed: true, }, - // "semantic_version": { - // Type: schema.TypeString, - // Optional: true, - // Computed: true, - // }, - // "outputs": { - // Type: schema.TypeMap, - // Computed: true, - // }, + "semantic_version": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, }, } } @@ -69,6 +66,10 @@ func resourceAwsServerlessRepositoryApplicationCreate(d *schema.ResourceData, me StackName: aws.String(d.Get("name").(string)), ApplicationId: aws.String(d.Get("application_id").(string)), } + if v, ok := d.GetOk("semantic_version"); ok { + version := v.(string) + changeSetRequest.SemanticVersion = aws.String(version) + } if v, ok := d.GetOk("parameters"); ok { changeSetRequest.ParameterOverrides = expandServerlessRepositoryApplicationParameters(v.(map[string]interface{})) } @@ -214,12 +215,26 @@ func resourceAwsServerlessRepositoryApplicationCreate(d *schema.ResourceData, me } func resourceAwsServerlessRepositoryApplicationRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cfconn + serverlessConn := meta.(*AWSClient).serverlessapplicationrepositoryconn + cfConn := meta.(*AWSClient).cfconn + + getApplicationInput := &serverlessapplicationrepository.GetApplicationInput{ + ApplicationId: aws.String(d.Get("application_id").(string)), + } + + _, ok := d.GetOk("semantic_version") + if !ok { + getApplicationOutput, err := serverlessConn.GetApplication(getApplicationInput) + if err != nil { + return err + } + d.Set("semantic_version", getApplicationOutput.Version.SemanticVersion) + } input := &cloudformation.DescribeStacksInput{ StackName: aws.String(d.Id()), } - resp, err := conn.DescribeStacks(input) + resp, err := cfConn.DescribeStacks(input) if err != nil { awsErr, ok := err.(awserr.Error) // ValidationError: Stack with id % does not exist @@ -250,7 +265,8 @@ func resourceAwsServerlessRepositoryApplicationRead(d *schema.ResourceData, meta stack := stacks[0] log.Printf("[DEBUG] Received CloudFormation stack: %s", stack) - // Serverless Application Repo prefixes the stack with "serverlessrepo-", so remove it + // Serverless Application Repo prefixes the stack with "serverlessrepo-", + // so remove it from the saved string stackName := strings.TrimPrefix(*stack.StackName, "serverlessrepo-") d.Set("name", &stackName) @@ -260,18 +276,9 @@ func resourceAwsServerlessRepositoryApplicationRead(d *schema.ResourceData, meta return err } - // err = d.Set("tags", flattenCloudFormationTags(stack.Tags)) - // if err != nil { - // return err - // } - - // err = d.Set("outputs", flattenCloudFormationOutputs(stack.Outputs)) - // if err != nil { - // return err - // } - return nil } + func resourceAwsServerlessRepositoryApplicationDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).cfconn diff --git a/aws/resource_aws_serverlessrepo_application_test.go b/aws/resource_aws_serverlessrepo_application_test.go index b2d12d8525c..824a4d04f6a 100644 --- a/aws/resource_aws_serverlessrepo_application_test.go +++ b/aws/resource_aws_serverlessrepo_application_test.go @@ -24,6 +24,29 @@ func TestAccAwsServerlessRepositoryApplication_Basic(t *testing.T) { Config: testAccAwsServerlessRepositoryApplicationConfig(stackName), Check: resource.ComposeTestCheckFunc( testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_application.postgres-rotator", &stack), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), + resource.TestCheckResourceAttrSet("aws_serverlessrepository_application.postgres-rotator", "semantic_version"), + ), + }, + }, + }) +} + +func TestAccAwsServerlessRepositoryApplication_Versioned(t *testing.T) { + var stack cloudformation.Stack + stackName := fmt.Sprintf("tf-acc-test-versioned-%s", acctest.RandString(10)) + const version = "1.0.15" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSCloudFormationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSServerlessRepositoryApplicationConfig_versioned(stackName, version), + Check: resource.ComposeTestCheckFunc( + testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_application.postgres-rotator", &stack), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "semantic_version", version), ), }, }, @@ -42,6 +65,19 @@ resource "aws_serverlessrepository_application" "postgres-rotator" { }`, stackName) } +func testAccAWSServerlessRepositoryApplicationConfig_versioned(stackName, version string) string { + return fmt.Sprintf(` +resource "aws_serverlessrepository_application" "postgres-rotator" { + name = "%[1]s" + application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" + semantic_version = "%[2]s" + parameters = { + functionName = "func-%[1]s" + endpoint = "secretsmanager.us-east-2.amazonaws.com" + } +}`, stackName, version) +} + func testAccCheckerverlessRepositoryApplicationExists(n string, stack *cloudformation.Stack) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] From 69b0823f4a8f635c952ff51175ba047686f800ef Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 17 Oct 2018 00:25:14 -0700 Subject: [PATCH 07/42] Added test for changing application version --- ...rce_aws_serverlessrepo_application_test.go | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/aws/resource_aws_serverlessrepo_application_test.go b/aws/resource_aws_serverlessrepo_application_test.go index 824a4d04f6a..b4defb6d339 100644 --- a/aws/resource_aws_serverlessrepo_application_test.go +++ b/aws/resource_aws_serverlessrepo_application_test.go @@ -53,6 +53,37 @@ func TestAccAwsServerlessRepositoryApplication_Versioned(t *testing.T) { }) } +func TestAccAwsServerlessRepositoryApplication_UpdateVersion(t *testing.T) { + var stack cloudformation.Stack + stackName := fmt.Sprintf("tf-acc-test-update-%s", acctest.RandString(10)) + const initialVersion = "1.0.15" + const updateVersion = "1.0.36" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSCloudFormationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSServerlessRepositoryApplicationConfig_versioned(stackName, initialVersion), + Check: resource.ComposeTestCheckFunc( + testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_application.postgres-rotator", &stack), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "semantic_version", initialVersion), + ), + }, + { + Config: testAccAWSServerlessRepositoryApplicationConfig_versioned(stackName, updateVersion), + Check: resource.ComposeTestCheckFunc( + testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_application.postgres-rotator", &stack), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "semantic_version", updateVersion), + ), + }, + }, + }) +} + func testAccAwsServerlessRepositoryApplicationConfig(stackName string) string { return fmt.Sprintf(` resource "aws_serverlessrepository_application" "postgres-rotator" { From d6a90ec41ffb8a668cfb2524f96ae0b4106e8259 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 22 Oct 2018 22:02:19 -0700 Subject: [PATCH 08/42] Added parameter tests for basic case --- aws/resource_aws_serverlessrepo_application_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_serverlessrepo_application_test.go b/aws/resource_aws_serverlessrepo_application_test.go index b4defb6d339..40c37dc8dc4 100644 --- a/aws/resource_aws_serverlessrepo_application_test.go +++ b/aws/resource_aws_serverlessrepo_application_test.go @@ -26,6 +26,9 @@ func TestAccAwsServerlessRepositoryApplication_Basic(t *testing.T) { testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_application.postgres-rotator", &stack), resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), resource.TestCheckResourceAttrSet("aws_serverlessrepository_application.postgres-rotator", "semantic_version"), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.%", "2"), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.functionName", fmt.Sprintf("func-%s", stackName)), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.endpoint", "secretsmanager.us-east-2.amazonaws.com"), ), }, }, From 48a747a32176fd4245f10c01ec370a948cca7183 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 22 Oct 2018 22:02:52 -0700 Subject: [PATCH 09/42] Formatting changes --- aws/resource_aws_serverlessrepo_application_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aws/resource_aws_serverlessrepo_application_test.go b/aws/resource_aws_serverlessrepo_application_test.go index 40c37dc8dc4..71b566c9a41 100644 --- a/aws/resource_aws_serverlessrepo_application_test.go +++ b/aws/resource_aws_serverlessrepo_application_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform/terraform" ) -func TestAccAwsServerlessRepositoryApplication_Basic(t *testing.T) { +func TestAccAwsServerlessRepositoryApplication_basic(t *testing.T) { var stack cloudformation.Stack stackName := fmt.Sprintf("tf-acc-test-basic-%s", acctest.RandString(10)) @@ -35,7 +35,7 @@ func TestAccAwsServerlessRepositoryApplication_Basic(t *testing.T) { }) } -func TestAccAwsServerlessRepositoryApplication_Versioned(t *testing.T) { +func TestAccAwsServerlessRepositoryApplication_versioned(t *testing.T) { var stack cloudformation.Stack stackName := fmt.Sprintf("tf-acc-test-versioned-%s", acctest.RandString(10)) const version = "1.0.15" @@ -56,7 +56,7 @@ func TestAccAwsServerlessRepositoryApplication_Versioned(t *testing.T) { }) } -func TestAccAwsServerlessRepositoryApplication_UpdateVersion(t *testing.T) { +func TestAccAWSServerlessRepositoryApplication_updateVersion(t *testing.T) { var stack cloudformation.Stack stackName := fmt.Sprintf("tf-acc-test-update-%s", acctest.RandString(10)) const initialVersion = "1.0.15" From 14c40a287bc833f9895d037fdaff7664f48b6847 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 22 Oct 2018 23:53:45 -0700 Subject: [PATCH 10/42] Added outputs to serverless repo application --- aws/resource_aws_serverlessrepo_application.go | 9 +++++++++ aws/resource_aws_serverlessrepo_application_test.go | 2 ++ 2 files changed, 11 insertions(+) diff --git a/aws/resource_aws_serverlessrepo_application.go b/aws/resource_aws_serverlessrepo_application.go index bcb6f478bdc..adefb87c7ad 100644 --- a/aws/resource_aws_serverlessrepo_application.go +++ b/aws/resource_aws_serverlessrepo_application.go @@ -54,6 +54,10 @@ func resourceAwsServerlessRepositoryApplication() *schema.Resource { Computed: true, ForceNew: true, }, + "outputs": { + Type: schema.TypeMap, + Computed: true, + }, }, } } @@ -276,6 +280,11 @@ func resourceAwsServerlessRepositoryApplicationRead(d *schema.ResourceData, meta return err } + err = d.Set("outputs", flattenCloudFormationOutputs(stack.Outputs)) + if err != nil { + return err + } + return nil } diff --git a/aws/resource_aws_serverlessrepo_application_test.go b/aws/resource_aws_serverlessrepo_application_test.go index 71b566c9a41..4e9493db01c 100644 --- a/aws/resource_aws_serverlessrepo_application_test.go +++ b/aws/resource_aws_serverlessrepo_application_test.go @@ -29,6 +29,8 @@ func TestAccAwsServerlessRepositoryApplication_basic(t *testing.T) { resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.%", "2"), resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.functionName", fmt.Sprintf("func-%s", stackName)), resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.endpoint", "secretsmanager.us-east-2.amazonaws.com"), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "outputs.%", "1"), + resource.TestCheckResourceAttrSet("aws_serverlessrepository_application.postgres-rotator", "outputs.RotationLambdaARN"), ), }, }, From 8ad21112497bf351233f1eabcf94acb0c91cdb12 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Sat, 10 Nov 2018 23:42:24 -0800 Subject: [PATCH 11/42] Added CloudFormation `capabilities` field as output; needed for update --- aws/resource_aws_serverlessrepo_application.go | 15 ++++++++++++++- ...esource_aws_serverlessrepo_application_test.go | 4 +++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_serverlessrepo_application.go b/aws/resource_aws_serverlessrepo_application.go index adefb87c7ad..9ed20760a95 100644 --- a/aws/resource_aws_serverlessrepo_application.go +++ b/aws/resource_aws_serverlessrepo_application.go @@ -18,7 +18,7 @@ func resourceAwsServerlessRepositoryApplication() *schema.Resource { return &schema.Resource{ Create: resourceAwsServerlessRepositoryApplicationCreate, Read: resourceAwsServerlessRepositoryApplicationRead, - // Update: resourceAwsServerlessRepositoryApplicationUpdate, + //Update: resourceAwsServerlessRepositoryApplicationUpdate, Delete: resourceAwsServerlessRepositoryApplicationDelete, Importer: &schema.ResourceImporter{ @@ -58,6 +58,12 @@ func resourceAwsServerlessRepositoryApplication() *schema.Resource { Type: schema.TypeMap, Computed: true, }, + "capabilities": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, }, } } @@ -285,6 +291,13 @@ func resourceAwsServerlessRepositoryApplicationRead(d *schema.ResourceData, meta return err } + if len(stack.Capabilities) > 0 { + err = d.Set("capabilities", schema.NewSet(schema.HashString, flattenStringList(stack.Capabilities))) + if err != nil { + return err + } + } + return nil } diff --git a/aws/resource_aws_serverlessrepo_application_test.go b/aws/resource_aws_serverlessrepo_application_test.go index 4e9493db01c..8f215794fb7 100644 --- a/aws/resource_aws_serverlessrepo_application_test.go +++ b/aws/resource_aws_serverlessrepo_application_test.go @@ -31,6 +31,8 @@ func TestAccAwsServerlessRepositoryApplication_basic(t *testing.T) { resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.endpoint", "secretsmanager.us-east-2.amazonaws.com"), resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "outputs.%", "1"), resource.TestCheckResourceAttrSet("aws_serverlessrepository_application.postgres-rotator", "outputs.RotationLambdaARN"), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "capabilities.#", "1"), + //resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "capabilities.0", "CAPABILITY_NAMED_IAM"), ), }, }, @@ -58,7 +60,7 @@ func TestAccAwsServerlessRepositoryApplication_versioned(t *testing.T) { }) } -func TestAccAWSServerlessRepositoryApplication_updateVersion(t *testing.T) { +func TestAccAwsServerlessRepositoryApplication_updateVersion(t *testing.T) { var stack cloudformation.Stack stackName := fmt.Sprintf("tf-acc-test-update-%s", acctest.RandString(10)) const initialVersion = "1.0.15" From 41c3a7f3b78d624cf59a388a366789a342bec6b0 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 12 Nov 2018 23:46:04 -0800 Subject: [PATCH 12/42] Factored waiting for creation of CloudFormation change set to separate function; will be reused for Update --- ...resource_aws_serverlessrepo_application.go | 67 ++++++++++--------- 1 file changed, 36 insertions(+), 31 deletions(-) diff --git a/aws/resource_aws_serverlessrepo_application.go b/aws/resource_aws_serverlessrepo_application.go index 9ed20760a95..df588f57afc 100644 --- a/aws/resource_aws_serverlessrepo_application.go +++ b/aws/resource_aws_serverlessrepo_application.go @@ -84,43 +84,15 @@ func resourceAwsServerlessRepositoryApplicationCreate(d *schema.ResourceData, me changeSetRequest.ParameterOverrides = expandServerlessRepositoryApplicationParameters(v.(map[string]interface{})) } - log.Printf("[DEBUG] Creating Serverless Repo Application Change Set: %s", changeSetRequest) + log.Printf("[DEBUG] Creating Serverless Repo Application change set: %s", changeSetRequest) changeSetResponse, err := serverlessConn.CreateCloudFormationChangeSet(&changeSetRequest) if err != nil { - return fmt.Errorf("Creating Serverless Repo Application Change Set failed: %s", err.Error()) + return fmt.Errorf("Creating Serverless Repo Application change set failed: %s", err.Error()) } d.SetId(*changeSetResponse.StackId) - var lastChangeSetStatus string - changeSetWait := resource.StateChangeConf{ - Pending: []string{ - "CREATE_PENDING", - "CREATE_IN_PROGRESS", - }, - Target: []string{ - "CREATE_COMPLETE", - "DELETE_COMPLETE", - "FAILED", - }, - Timeout: d.Timeout(schema.TimeoutCreate), - MinTimeout: 1 * time.Second, - Refresh: func() (interface{}, string, error) { - resp, err := cfConn.DescribeChangeSet(&cloudformation.DescribeChangeSetInput{ - ChangeSetName: changeSetResponse.ChangeSetId, - }) - if err != nil { - log.Printf("[ERROR] Failed to describe Change Set: %s", err) - return nil, "", err - } - status := *resp.Status - lastChangeSetStatus = status - log.Printf("[DEBUG] Current CloudFormation stack status: %q", status) - - return resp, status, err - }, - } - _, err = changeSetWait.WaitForState() + lastChangeSetStatus, err := waitForCreateChangeSet(d, cfConn, changeSetResponse.ChangeSetId) if err != nil { return err } @@ -385,6 +357,39 @@ func resourceAwsServerlessRepositoryApplicationDelete(d *schema.ResourceData, me return nil } +func waitForCreateChangeSet(d *schema.ResourceData, conn *cloudformation.CloudFormation, changeSetName *string) (string, error) { + var lastChangeSetStatus string + changeSetWait := resource.StateChangeConf{ + Pending: []string{ + "CREATE_PENDING", + "CREATE_IN_PROGRESS", + }, + Target: []string{ + "CREATE_COMPLETE", + "DELETE_COMPLETE", + "FAILED", + }, + Timeout: d.Timeout(schema.TimeoutCreate), + MinTimeout: 1 * time.Second, + Refresh: func() (interface{}, string, error) { + resp, err := conn.DescribeChangeSet(&cloudformation.DescribeChangeSetInput{ + ChangeSetName: changeSetName, + }) + if err != nil { + log.Printf("[ERROR] Failed to describe change set: %s", err) + return nil, "", err + } + status := *resp.Status + lastChangeSetStatus = status + log.Printf("[DEBUG] Current CloudFormation stack status: %q", status) + + return resp, status, err + }, + } + _, err := changeSetWait.WaitForState() + return lastChangeSetStatus, err +} + // Move to `structure.go`? func expandServerlessRepositoryApplicationParameters(params map[string]interface{}) []*serverlessapplicationrepository.ParameterValue { var appParams []*serverlessapplicationrepository.ParameterValue From 8b6e857a4948c0ddfa99acf3da37754d51d5cc98 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 12 Nov 2018 23:56:28 -0800 Subject: [PATCH 13/42] Moved status check into function as well --- ...resource_aws_serverlessrepo_application.go | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/aws/resource_aws_serverlessrepo_application.go b/aws/resource_aws_serverlessrepo_application.go index df588f57afc..9394ee8b4c9 100644 --- a/aws/resource_aws_serverlessrepo_application.go +++ b/aws/resource_aws_serverlessrepo_application.go @@ -92,19 +92,11 @@ func resourceAwsServerlessRepositoryApplicationCreate(d *schema.ResourceData, me d.SetId(*changeSetResponse.StackId) - lastChangeSetStatus, err := waitForCreateChangeSet(d, cfConn, changeSetResponse.ChangeSetId) + err = waitForCreateChangeSet(d, cfConn, changeSetResponse.ChangeSetId) if err != nil { return err } - if lastChangeSetStatus == "FAILED" { - reasons, err := getCloudFormationFailures(d.Id(), cfConn) - if err != nil { - return fmt.Errorf("Failed getting failure reasons: %q", err.Error()) - } - return fmt.Errorf("%s: %q", lastChangeSetStatus, reasons) - } - executeRequest := cloudformation.ExecuteChangeSetInput{ ChangeSetName: changeSetResponse.ChangeSetId, } @@ -357,7 +349,7 @@ func resourceAwsServerlessRepositoryApplicationDelete(d *schema.ResourceData, me return nil } -func waitForCreateChangeSet(d *schema.ResourceData, conn *cloudformation.CloudFormation, changeSetName *string) (string, error) { +func waitForCreateChangeSet(d *schema.ResourceData, conn *cloudformation.CloudFormation, changeSetName *string) error { var lastChangeSetStatus string changeSetWait := resource.StateChangeConf{ Pending: []string{ @@ -387,7 +379,15 @@ func waitForCreateChangeSet(d *schema.ResourceData, conn *cloudformation.CloudFo }, } _, err := changeSetWait.WaitForState() - return lastChangeSetStatus, err + + if lastChangeSetStatus == "FAILED" { + reasons, err := getCloudFormationFailures(d.Id(), conn) + if err != nil { + return fmt.Errorf("Failed getting failure reasons: %q", err.Error()) + } + return fmt.Errorf("%s: %q", lastChangeSetStatus, reasons) + } + return err } // Move to `structure.go`? From 6f280513ff22b79e110c464279acf6211a9e296b Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 13 Nov 2018 00:17:03 -0800 Subject: [PATCH 14/42] Factored waiting for execution of CloudFormation change set to separate function; will be reused for Update --- ...resource_aws_serverlessrepo_application.go | 150 +++++++++--------- 1 file changed, 77 insertions(+), 73 deletions(-) diff --git a/aws/resource_aws_serverlessrepo_application.go b/aws/resource_aws_serverlessrepo_application.go index 9394ee8b4c9..4e8f4649501 100644 --- a/aws/resource_aws_serverlessrepo_application.go +++ b/aws/resource_aws_serverlessrepo_application.go @@ -105,84 +105,12 @@ func resourceAwsServerlessRepositoryApplicationCreate(d *schema.ResourceData, me if err != nil { return fmt.Errorf("Executing Change Set failed: %s", err.Error()) } - var lastStatus string - wait := resource.StateChangeConf{ - Pending: []string{ - "CREATE_IN_PROGRESS", - "DELETE_IN_PROGRESS", - "ROLLBACK_IN_PROGRESS", - }, - Target: []string{ - "CREATE_COMPLETE", - "CREATE_FAILED", - "DELETE_COMPLETE", - "DELETE_FAILED", - "ROLLBACK_COMPLETE", - "ROLLBACK_FAILED", - }, - Timeout: d.Timeout(schema.TimeoutCreate), - MinTimeout: 1 * time.Second, - Refresh: func() (interface{}, string, error) { - resp, err := cfConn.DescribeStacks(&cloudformation.DescribeStacksInput{ - StackName: aws.String(d.Id()), - }) - if err != nil { - log.Printf("[ERROR] Failed to describe stacks: %s", err) - return nil, "", err - } - if len(resp.Stacks) == 0 { - // This shouldn't happen unless CloudFormation is inconsistent - // See https://github.com/hashicorp/terraform/issues/5487 - log.Printf("[WARN] CloudFormation stack %q not found.\nresponse: %q", - d.Id(), resp) - return resp, "", fmt.Errorf( - "CloudFormation stack %q vanished unexpectedly during creation.\n"+ - "Unless you knowingly manually deleted the stack "+ - "please report this as bug at https://github.com/hashicorp/terraform/issues\n"+ - "along with the config & Terraform version & the details below:\n"+ - "Full API response: %s\n", - d.Id(), resp) - } - - status := *resp.Stacks[0].StackStatus - lastStatus = status - log.Printf("[DEBUG] Current CloudFormation stack status: %q", status) - - return resp, status, err - }, - } - - _, err = wait.WaitForState() + err = waitForExecuteChangeSet(d, cfConn) if err != nil { return err } - if lastStatus == "ROLLBACK_COMPLETE" || lastStatus == "ROLLBACK_FAILED" { - reasons, err := getCloudFormationRollbackReasons(d.Id(), nil, cfConn) - if err != nil { - return fmt.Errorf("Failed getting rollback reasons: %q", err.Error()) - } - - return fmt.Errorf("%s: %q", lastStatus, reasons) - } - if lastStatus == "DELETE_COMPLETE" || lastStatus == "DELETE_FAILED" { - reasons, err := getCloudFormationDeletionReasons(d.Id(), cfConn) - if err != nil { - return fmt.Errorf("Failed getting deletion reasons: %q", err.Error()) - } - - d.SetId("") - return fmt.Errorf("%s: %q", lastStatus, reasons) - } - if lastStatus == "CREATE_FAILED" { - reasons, err := getCloudFormationFailures(d.Id(), cfConn) - if err != nil { - return fmt.Errorf("Failed getting failure reasons: %q", err.Error()) - } - return fmt.Errorf("%s: %q", lastStatus, reasons) - } - log.Printf("[INFO] CloudFormation Stack %q created", d.Id()) return resourceAwsServerlessRepositoryApplicationRead(d, meta) @@ -390,6 +318,82 @@ func waitForCreateChangeSet(d *schema.ResourceData, conn *cloudformation.CloudFo return err } +func waitForExecuteChangeSet(d *schema.ResourceData, conn *cloudformation.CloudFormation) error { + var lastStatus string + wait := resource.StateChangeConf{ + Pending: []string{ + "CREATE_IN_PROGRESS", + "DELETE_IN_PROGRESS", + "ROLLBACK_IN_PROGRESS", + }, + Target: []string{ + "CREATE_COMPLETE", + "CREATE_FAILED", + "DELETE_COMPLETE", + "DELETE_FAILED", + "ROLLBACK_COMPLETE", + "ROLLBACK_FAILED", + }, + Timeout: d.Timeout(schema.TimeoutCreate), + MinTimeout: 1 * time.Second, + Refresh: func() (interface{}, string, error) { + resp, err := conn.DescribeStacks(&cloudformation.DescribeStacksInput{ + StackName: aws.String(d.Id()), + }) + if err != nil { + log.Printf("[ERROR] Failed to describe stacks: %s", err) + return nil, "", err + } + if len(resp.Stacks) == 0 { + // This shouldn't happen unless CloudFormation is inconsistent + // See https://github.com/hashicorp/terraform/issues/5487 + log.Printf("[WARN] CloudFormation stack %q not found.\nresponse: %q", + d.Id(), resp) + return resp, "", fmt.Errorf( + "CloudFormation stack %q vanished unexpectedly during creation.\n"+ + "Unless you knowingly manually deleted the stack "+ + "please report this as bug at https://github.com/hashicorp/terraform/issues\n"+ + "along with the config & Terraform version & the details below:\n"+ + "Full API response: %s\n", + d.Id(), resp) + } + + status := *resp.Stacks[0].StackStatus + lastStatus = status + log.Printf("[DEBUG] Current CloudFormation stack status: %q", status) + + return resp, status, err + }, + } + _, err := wait.WaitForState() + if lastStatus == "ROLLBACK_COMPLETE" || lastStatus == "ROLLBACK_FAILED" { + reasons, err := getCloudFormationRollbackReasons(d.Id(), nil, conn) + if err != nil { + return fmt.Errorf("Failed getting rollback reasons: %q", err.Error()) + } + + return fmt.Errorf("%s: %q", lastStatus, reasons) + } + if lastStatus == "DELETE_COMPLETE" || lastStatus == "DELETE_FAILED" { + reasons, err := getCloudFormationDeletionReasons(d.Id(), conn) + if err != nil { + return fmt.Errorf("Failed getting deletion reasons: %q", err.Error()) + } + + d.SetId("") + return fmt.Errorf("%s: %q", lastStatus, reasons) + } + if lastStatus == "CREATE_FAILED" { + reasons, err := getCloudFormationFailures(d.Id(), conn) + if err != nil { + return fmt.Errorf("Failed getting failure reasons: %q", err.Error()) + } + return fmt.Errorf("%s: %q", lastStatus, reasons) + } + + return err +} + // Move to `structure.go`? func expandServerlessRepositoryApplicationParameters(params map[string]interface{}) []*serverlessapplicationrepository.ParameterValue { var appParams []*serverlessapplicationrepository.ParameterValue From 0b42e3e3c024e57eb9e65c541d5fcdb14660486e Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 13 Nov 2018 21:49:44 -0800 Subject: [PATCH 15/42] Revert "Factored waiting for execution of CloudFormation change set to separate function; will be reused for Update" This was a premature simplification --- ...resource_aws_serverlessrepo_application.go | 150 +++++++++--------- 1 file changed, 73 insertions(+), 77 deletions(-) diff --git a/aws/resource_aws_serverlessrepo_application.go b/aws/resource_aws_serverlessrepo_application.go index 4e8f4649501..9394ee8b4c9 100644 --- a/aws/resource_aws_serverlessrepo_application.go +++ b/aws/resource_aws_serverlessrepo_application.go @@ -105,12 +105,84 @@ func resourceAwsServerlessRepositoryApplicationCreate(d *schema.ResourceData, me if err != nil { return fmt.Errorf("Executing Change Set failed: %s", err.Error()) } + var lastStatus string - err = waitForExecuteChangeSet(d, cfConn) + wait := resource.StateChangeConf{ + Pending: []string{ + "CREATE_IN_PROGRESS", + "DELETE_IN_PROGRESS", + "ROLLBACK_IN_PROGRESS", + }, + Target: []string{ + "CREATE_COMPLETE", + "CREATE_FAILED", + "DELETE_COMPLETE", + "DELETE_FAILED", + "ROLLBACK_COMPLETE", + "ROLLBACK_FAILED", + }, + Timeout: d.Timeout(schema.TimeoutCreate), + MinTimeout: 1 * time.Second, + Refresh: func() (interface{}, string, error) { + resp, err := cfConn.DescribeStacks(&cloudformation.DescribeStacksInput{ + StackName: aws.String(d.Id()), + }) + if err != nil { + log.Printf("[ERROR] Failed to describe stacks: %s", err) + return nil, "", err + } + if len(resp.Stacks) == 0 { + // This shouldn't happen unless CloudFormation is inconsistent + // See https://github.com/hashicorp/terraform/issues/5487 + log.Printf("[WARN] CloudFormation stack %q not found.\nresponse: %q", + d.Id(), resp) + return resp, "", fmt.Errorf( + "CloudFormation stack %q vanished unexpectedly during creation.\n"+ + "Unless you knowingly manually deleted the stack "+ + "please report this as bug at https://github.com/hashicorp/terraform/issues\n"+ + "along with the config & Terraform version & the details below:\n"+ + "Full API response: %s\n", + d.Id(), resp) + } + + status := *resp.Stacks[0].StackStatus + lastStatus = status + log.Printf("[DEBUG] Current CloudFormation stack status: %q", status) + + return resp, status, err + }, + } + + _, err = wait.WaitForState() if err != nil { return err } + if lastStatus == "ROLLBACK_COMPLETE" || lastStatus == "ROLLBACK_FAILED" { + reasons, err := getCloudFormationRollbackReasons(d.Id(), nil, cfConn) + if err != nil { + return fmt.Errorf("Failed getting rollback reasons: %q", err.Error()) + } + + return fmt.Errorf("%s: %q", lastStatus, reasons) + } + if lastStatus == "DELETE_COMPLETE" || lastStatus == "DELETE_FAILED" { + reasons, err := getCloudFormationDeletionReasons(d.Id(), cfConn) + if err != nil { + return fmt.Errorf("Failed getting deletion reasons: %q", err.Error()) + } + + d.SetId("") + return fmt.Errorf("%s: %q", lastStatus, reasons) + } + if lastStatus == "CREATE_FAILED" { + reasons, err := getCloudFormationFailures(d.Id(), cfConn) + if err != nil { + return fmt.Errorf("Failed getting failure reasons: %q", err.Error()) + } + return fmt.Errorf("%s: %q", lastStatus, reasons) + } + log.Printf("[INFO] CloudFormation Stack %q created", d.Id()) return resourceAwsServerlessRepositoryApplicationRead(d, meta) @@ -318,82 +390,6 @@ func waitForCreateChangeSet(d *schema.ResourceData, conn *cloudformation.CloudFo return err } -func waitForExecuteChangeSet(d *schema.ResourceData, conn *cloudformation.CloudFormation) error { - var lastStatus string - wait := resource.StateChangeConf{ - Pending: []string{ - "CREATE_IN_PROGRESS", - "DELETE_IN_PROGRESS", - "ROLLBACK_IN_PROGRESS", - }, - Target: []string{ - "CREATE_COMPLETE", - "CREATE_FAILED", - "DELETE_COMPLETE", - "DELETE_FAILED", - "ROLLBACK_COMPLETE", - "ROLLBACK_FAILED", - }, - Timeout: d.Timeout(schema.TimeoutCreate), - MinTimeout: 1 * time.Second, - Refresh: func() (interface{}, string, error) { - resp, err := conn.DescribeStacks(&cloudformation.DescribeStacksInput{ - StackName: aws.String(d.Id()), - }) - if err != nil { - log.Printf("[ERROR] Failed to describe stacks: %s", err) - return nil, "", err - } - if len(resp.Stacks) == 0 { - // This shouldn't happen unless CloudFormation is inconsistent - // See https://github.com/hashicorp/terraform/issues/5487 - log.Printf("[WARN] CloudFormation stack %q not found.\nresponse: %q", - d.Id(), resp) - return resp, "", fmt.Errorf( - "CloudFormation stack %q vanished unexpectedly during creation.\n"+ - "Unless you knowingly manually deleted the stack "+ - "please report this as bug at https://github.com/hashicorp/terraform/issues\n"+ - "along with the config & Terraform version & the details below:\n"+ - "Full API response: %s\n", - d.Id(), resp) - } - - status := *resp.Stacks[0].StackStatus - lastStatus = status - log.Printf("[DEBUG] Current CloudFormation stack status: %q", status) - - return resp, status, err - }, - } - _, err := wait.WaitForState() - if lastStatus == "ROLLBACK_COMPLETE" || lastStatus == "ROLLBACK_FAILED" { - reasons, err := getCloudFormationRollbackReasons(d.Id(), nil, conn) - if err != nil { - return fmt.Errorf("Failed getting rollback reasons: %q", err.Error()) - } - - return fmt.Errorf("%s: %q", lastStatus, reasons) - } - if lastStatus == "DELETE_COMPLETE" || lastStatus == "DELETE_FAILED" { - reasons, err := getCloudFormationDeletionReasons(d.Id(), conn) - if err != nil { - return fmt.Errorf("Failed getting deletion reasons: %q", err.Error()) - } - - d.SetId("") - return fmt.Errorf("%s: %q", lastStatus, reasons) - } - if lastStatus == "CREATE_FAILED" { - reasons, err := getCloudFormationFailures(d.Id(), conn) - if err != nil { - return fmt.Errorf("Failed getting failure reasons: %q", err.Error()) - } - return fmt.Errorf("%s: %q", lastStatus, reasons) - } - - return err -} - // Move to `structure.go`? func expandServerlessRepositoryApplicationParameters(params map[string]interface{}) []*serverlessapplicationrepository.ParameterValue { var appParams []*serverlessapplicationrepository.ParameterValue From 8f715b7d96b53f83106bd91f5a86d605e4960dda Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 14 Nov 2018 00:04:38 -0800 Subject: [PATCH 16/42] Added Update to serverless application --- ...resource_aws_serverlessrepo_application.go | 103 +++++++++++++++++- ...rce_aws_serverlessrepo_application_test.go | 42 +++++++ 2 files changed, 144 insertions(+), 1 deletion(-) diff --git a/aws/resource_aws_serverlessrepo_application.go b/aws/resource_aws_serverlessrepo_application.go index 9394ee8b4c9..ecdeae3c38a 100644 --- a/aws/resource_aws_serverlessrepo_application.go +++ b/aws/resource_aws_serverlessrepo_application.go @@ -18,7 +18,7 @@ func resourceAwsServerlessRepositoryApplication() *schema.Resource { return &schema.Resource{ Create: resourceAwsServerlessRepositoryApplicationCreate, Read: resourceAwsServerlessRepositoryApplicationRead, - //Update: resourceAwsServerlessRepositoryApplicationUpdate, + Update: resourceAwsServerlessRepositoryApplicationUpdate, Delete: resourceAwsServerlessRepositoryApplicationDelete, Importer: &schema.ResourceImporter{ @@ -265,6 +265,107 @@ func resourceAwsServerlessRepositoryApplicationRead(d *schema.ResourceData, meta return nil } +func resourceAwsServerlessRepositoryApplicationUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).cfconn + + input := &cloudformation.CreateChangeSetInput{ + StackName: aws.String(d.Id()), + UsePreviousTemplate: aws.Bool(true), + ChangeSetType: aws.String("UPDATE"), + } + + input.ChangeSetName = aws.String(fmt.Sprintf("%s-%s", + d.Get("name").(string), + time.Now().UTC().Format("20060102150405999999999"))) + + // Parameters must be present whether they are changed or not + if v, ok := d.GetOk("parameters"); ok { + input.Parameters = expandCloudFormationParameters(v.(map[string]interface{})) + } + + capabilities := d.Get("capabilities") + input.Capabilities = expandStringList(capabilities.(*schema.Set).List()) + + log.Printf("[DEBUG] Creating CloudFormation change set: %s", input) + changeSetResponse, err := conn.CreateChangeSet(input) + if err != nil { + return fmt.Errorf("Creating CloudFormation change set failed: %s", err.Error()) + } + + err = waitForCreateChangeSet(d, conn, changeSetResponse.Id) + if err != nil { + return err + } + + executeRequest := cloudformation.ExecuteChangeSetInput{ + ChangeSetName: changeSetResponse.Id, + } + log.Printf("[DEBUG] Executing Change Set: %s", executeRequest) + _, err = conn.ExecuteChangeSet(&executeRequest) + if err != nil { + return fmt.Errorf("Executing Change Set failed: %s", err.Error()) + } + + lastUpdatedTime, err := getLastCfEventTimestamp(d.Id(), conn) + if err != nil { + return err + } + + var lastStatus string + var stackId string + wait := resource.StateChangeConf{ + Pending: []string{ + "UPDATE_COMPLETE_CLEANUP_IN_PROGRESS", + "UPDATE_IN_PROGRESS", + "UPDATE_ROLLBACK_IN_PROGRESS", + "UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS", + }, + Target: []string{ + "CREATE_COMPLETE", // If no stack update was performed + "UPDATE_COMPLETE", + "UPDATE_ROLLBACK_COMPLETE", + "UPDATE_ROLLBACK_FAILED", + }, + Timeout: d.Timeout(schema.TimeoutUpdate), + MinTimeout: 5 * time.Second, + Refresh: func() (interface{}, string, error) { + resp, err := conn.DescribeStacks(&cloudformation.DescribeStacksInput{ + StackName: aws.String(d.Id()), + }) + if err != nil { + log.Printf("[ERROR] Failed to describe stacks: %s", err) + return nil, "", err + } + + stackId = aws.StringValue(resp.Stacks[0].StackId) + + status := *resp.Stacks[0].StackStatus + lastStatus = status + log.Printf("[DEBUG] Current CloudFormation stack status: %q", status) + + return resp, status, err + }, + } + + _, err = wait.WaitForState() + if err != nil { + return err + } + + if lastStatus == "UPDATE_ROLLBACK_COMPLETE" || lastStatus == "UPDATE_ROLLBACK_FAILED" { + reasons, err := getCloudFormationRollbackReasons(stackId, lastUpdatedTime, conn) + if err != nil { + return fmt.Errorf("Failed getting details about rollback: %q", err.Error()) + } + + return fmt.Errorf("%s: %q", lastStatus, reasons) + } + + log.Printf("[DEBUG] CloudFormation stack %q has been updated", stackId) + + return resourceAwsServerlessRepositoryApplicationRead(d, meta) +} + func resourceAwsServerlessRepositoryApplicationDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).cfconn diff --git a/aws/resource_aws_serverlessrepo_application_test.go b/aws/resource_aws_serverlessrepo_application_test.go index 8f215794fb7..3677cd2dd96 100644 --- a/aws/resource_aws_serverlessrepo_application_test.go +++ b/aws/resource_aws_serverlessrepo_application_test.go @@ -91,6 +91,36 @@ func TestAccAwsServerlessRepositoryApplication_updateVersion(t *testing.T) { }) } +func TestAccAwsServerlessRepoApplication_updateFunctionName(t *testing.T) { + var stack cloudformation.Stack + stackName := fmt.Sprintf("tf-acc-test-update-name-%s", acctest.RandString(10)) + const initialName = "FuncName1" + const updatedName = "FuncName2" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSCloudFormationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSServerlessRepositoryApplicationConfig_functionName(stackName, initialName), + Check: resource.ComposeTestCheckFunc( + testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_application.postgres-rotator", &stack), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.functionName", initialName), + ), + }, + { + Config: testAccAWSServerlessRepositoryApplicationConfig_functionName(stackName, updatedName), + Check: resource.ComposeTestCheckFunc( + testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_application.postgres-rotator", &stack), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.functionName", updatedName), + ), + }, + }, + }) +} + func testAccAwsServerlessRepositoryApplicationConfig(stackName string) string { return fmt.Sprintf(` resource "aws_serverlessrepository_application" "postgres-rotator" { @@ -103,6 +133,18 @@ resource "aws_serverlessrepository_application" "postgres-rotator" { }`, stackName) } +func testAccAWSServerlessRepositoryApplicationConfig_functionName(stackName, functionName string) string { + return fmt.Sprintf(` +resource "aws_serverlessrepository_application" "postgres-rotator" { + name = "%[1]s" + application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" + parameters = { + functionName = "%[2]s" + endpoint = "secretsmanager.us-east-2.amazonaws.com" + } +}`, stackName, functionName) +} + func testAccAWSServerlessRepositoryApplicationConfig_versioned(stackName, version string) string { return fmt.Sprintf(` resource "aws_serverlessrepository_application" "postgres-rotator" { From 753fa55283504fe0b739752d778a1e86125df4e2 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 21 Nov 2018 00:33:53 -0800 Subject: [PATCH 17/42] Added tags to Read operation --- ...resource_aws_serverlessrepo_application.go | 29 +++++++++++++++++++ ...rce_aws_serverlessrepo_application_test.go | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/aws/resource_aws_serverlessrepo_application.go b/aws/resource_aws_serverlessrepo_application.go index ecdeae3c38a..b3cda7fb278 100644 --- a/aws/resource_aws_serverlessrepo_application.go +++ b/aws/resource_aws_serverlessrepo_application.go @@ -3,6 +3,7 @@ package aws import ( "fmt" "log" + "regexp" "strings" "time" @@ -64,6 +65,7 @@ func resourceAwsServerlessRepositoryApplication() *schema.Resource { Elem: &schema.Schema{Type: schema.TypeString}, Set: schema.HashString, }, + "tags": tagsSchema(), }, } } @@ -250,6 +252,11 @@ func resourceAwsServerlessRepositoryApplicationRead(d *schema.ResourceData, meta return err } + err = d.Set("tags", flattenServerlessRepositoryCloudFormationTags(stack.Tags)) + if err != nil { + return err + } + err = d.Set("outputs", flattenCloudFormationOutputs(stack.Outputs)) if err != nil { return err @@ -265,6 +272,28 @@ func resourceAwsServerlessRepositoryApplicationRead(d *schema.ResourceData, meta return nil } +func flattenServerlessRepositoryCloudFormationTags(cfTags []*cloudformation.Tag) map[string]string { + tags := make(map[string]string, len(cfTags)) + for _, t := range cfTags { + if !tagIgnoredServerlessRepositoryCloudFormation(*t.Key) { + tags[*t.Key] = *t.Value + } + } + return tags +} + +func tagIgnoredServerlessRepositoryCloudFormation(k string) bool { + filter := []string{"^aws:", "^serverlessrepo:"} + for _, v := range filter { + log.Printf("[DEBUG] Matching %v with %v\n", v, k) + if r, _ := regexp.MatchString(v, k); r == true { + log.Printf("[DEBUG] Found AWS specific tag %s, ignoring.\n", k) + return true + } + } + return false +} + func resourceAwsServerlessRepositoryApplicationUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).cfconn diff --git a/aws/resource_aws_serverlessrepo_application_test.go b/aws/resource_aws_serverlessrepo_application_test.go index 3677cd2dd96..cd12a42831b 100644 --- a/aws/resource_aws_serverlessrepo_application_test.go +++ b/aws/resource_aws_serverlessrepo_application_test.go @@ -91,7 +91,7 @@ func TestAccAwsServerlessRepositoryApplication_updateVersion(t *testing.T) { }) } -func TestAccAwsServerlessRepoApplication_updateFunctionName(t *testing.T) { +func TestAccAwsServerlessRepositoryApplication_updateFunctionName(t *testing.T) { var stack cloudformation.Stack stackName := fmt.Sprintf("tf-acc-test-update-name-%s", acctest.RandString(10)) const initialName = "FuncName1" From 76a3de2db75c14f428869edbdb524203e65cc253 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 5 Sep 2019 15:35:44 -0700 Subject: [PATCH 18/42] Add a test for reading tags This confirms that no tags show up in the state when no tags are added to the resource --- aws/resource_aws_serverlessrepo_application_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_serverlessrepo_application_test.go b/aws/resource_aws_serverlessrepo_application_test.go index cd12a42831b..99223e9de4c 100644 --- a/aws/resource_aws_serverlessrepo_application_test.go +++ b/aws/resource_aws_serverlessrepo_application_test.go @@ -33,6 +33,7 @@ func TestAccAwsServerlessRepositoryApplication_basic(t *testing.T) { resource.TestCheckResourceAttrSet("aws_serverlessrepository_application.postgres-rotator", "outputs.RotationLambdaARN"), resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "capabilities.#", "1"), //resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "capabilities.0", "CAPABILITY_NAMED_IAM"), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "tags.%", "0"), ), }, }, From 8344eb4f9682205f7a6fd8b0dccf2155c92b3541 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Sun, 8 Sep 2019 20:09:38 -0700 Subject: [PATCH 19/42] Fixes linting error --- aws/resource_aws_serverlessrepo_application.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_serverlessrepo_application.go b/aws/resource_aws_serverlessrepo_application.go index b3cda7fb278..dcb475471ec 100644 --- a/aws/resource_aws_serverlessrepo_application.go +++ b/aws/resource_aws_serverlessrepo_application.go @@ -286,7 +286,7 @@ func tagIgnoredServerlessRepositoryCloudFormation(k string) bool { filter := []string{"^aws:", "^serverlessrepo:"} for _, v := range filter { log.Printf("[DEBUG] Matching %v with %v\n", v, k) - if r, _ := regexp.MatchString(v, k); r == true { + if r, _ := regexp.MatchString(v, k); r { log.Printf("[DEBUG] Found AWS specific tag %s, ignoring.\n", k) return true } From cc1f10eb5dcb253f5b59fb9e579d4f75975b3223 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 9 Sep 2019 22:20:00 -0700 Subject: [PATCH 20/42] Creates and updates tags --- ...resource_aws_serverlessrepo_application.go | 18 +++++ ...rce_aws_serverlessrepo_application_test.go | 72 +++++++++++++++++-- 2 files changed, 85 insertions(+), 5 deletions(-) diff --git a/aws/resource_aws_serverlessrepo_application.go b/aws/resource_aws_serverlessrepo_application.go index dcb475471ec..c0050237490 100644 --- a/aws/resource_aws_serverlessrepo_application.go +++ b/aws/resource_aws_serverlessrepo_application.go @@ -85,6 +85,9 @@ func resourceAwsServerlessRepositoryApplicationCreate(d *schema.ResourceData, me if v, ok := d.GetOk("parameters"); ok { changeSetRequest.ParameterOverrides = expandServerlessRepositoryApplicationParameters(v.(map[string]interface{})) } + if v, ok := d.GetOk("tags"); ok { + changeSetRequest.Tags = expandServerlessRepositoryTags(v.(map[string]interface{})) + } log.Printf("[DEBUG] Creating Serverless Repo Application change set: %s", changeSetRequest) changeSetResponse, err := serverlessConn.CreateCloudFormationChangeSet(&changeSetRequest) @@ -272,6 +275,17 @@ func resourceAwsServerlessRepositoryApplicationRead(d *schema.ResourceData, meta return nil } +func expandServerlessRepositoryTags(tags map[string]interface{}) []*serverlessapplicationrepository.Tag { + var cfTags []*serverlessapplicationrepository.Tag + for k, v := range tags { + cfTags = append(cfTags, &serverlessapplicationrepository.Tag{ + Key: aws.String(k), + Value: aws.String(v.(string)), + }) + } + return cfTags +} + func flattenServerlessRepositoryCloudFormationTags(cfTags []*cloudformation.Tag) map[string]string { tags := make(map[string]string, len(cfTags)) for _, t := range cfTags { @@ -312,6 +326,10 @@ func resourceAwsServerlessRepositoryApplicationUpdate(d *schema.ResourceData, me input.Parameters = expandCloudFormationParameters(v.(map[string]interface{})) } + if v, ok := d.GetOk("tags"); ok { + input.Tags = expandCloudFormationTags(v.(map[string]interface{})) + } + capabilities := d.Get("capabilities") input.Capabilities = expandStringList(capabilities.(*schema.Set).List()) diff --git a/aws/resource_aws_serverlessrepo_application_test.go b/aws/resource_aws_serverlessrepo_application_test.go index 99223e9de4c..019b8b825aa 100644 --- a/aws/resource_aws_serverlessrepo_application_test.go +++ b/aws/resource_aws_serverlessrepo_application_test.go @@ -61,7 +61,28 @@ func TestAccAwsServerlessRepositoryApplication_versioned(t *testing.T) { }) } -func TestAccAwsServerlessRepositoryApplication_updateVersion(t *testing.T) { +func TestAccAwsServerlessRepositoryApplication_tagged(t *testing.T) { + var stack cloudformation.Stack + stackName := fmt.Sprintf("tf-acc-test-tagged-%s", acctest.RandString(10)) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSCloudFormationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsServerlessRepositoryApplicationConfig_tagged(stackName), + Check: resource.ComposeTestCheckFunc( + testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_application.postgres-rotator", &stack), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "tags.%", "1"), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "tags.MyTag", "My value"), + ), + }, + }, + }) +} + +func TestAccAwsServerlessRepositoryApplication_versionUpdate(t *testing.T) { var stack cloudformation.Stack stackName := fmt.Sprintf("tf-acc-test-update-%s", acctest.RandString(10)) const initialVersion = "1.0.15" @@ -92,7 +113,7 @@ func TestAccAwsServerlessRepositoryApplication_updateVersion(t *testing.T) { }) } -func TestAccAwsServerlessRepositoryApplication_updateFunctionName(t *testing.T) { +func TestAccAwsServerlessRepositoryApplication_update(t *testing.T) { var stack cloudformation.Stack stackName := fmt.Sprintf("tf-acc-test-update-name-%s", acctest.RandString(10)) const initialName = "FuncName1" @@ -104,18 +125,24 @@ func TestAccAwsServerlessRepositoryApplication_updateFunctionName(t *testing.T) CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSServerlessRepositoryApplicationConfig_functionName(stackName, initialName), + Config: testAccAWSServerlessRepositoryApplicationConfig_updateInitial(stackName, initialName), Check: resource.ComposeTestCheckFunc( testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_application.postgres-rotator", &stack), resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.functionName", initialName), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "tags.%", "2"), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "tags.ToDelete", "ToBeDeleted"), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "tags.ToUpdate", "InitialValue"), ), }, { - Config: testAccAWSServerlessRepositoryApplicationConfig_functionName(stackName, updatedName), + Config: testAccAWSServerlessRepositoryApplicationConfig_updateUpdated(stackName, updatedName), Check: resource.ComposeTestCheckFunc( testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_application.postgres-rotator", &stack), resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.functionName", updatedName), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "tags.%", "2"), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "tags.ToUpdate", "UpdatedValue"), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "tags.ToAdd", "AddedValue"), ), }, }, @@ -134,7 +161,7 @@ resource "aws_serverlessrepository_application" "postgres-rotator" { }`, stackName) } -func testAccAWSServerlessRepositoryApplicationConfig_functionName(stackName, functionName string) string { +func testAccAWSServerlessRepositoryApplicationConfig_updateInitial(stackName, functionName string) string { return fmt.Sprintf(` resource "aws_serverlessrepository_application" "postgres-rotator" { name = "%[1]s" @@ -143,6 +170,26 @@ resource "aws_serverlessrepository_application" "postgres-rotator" { functionName = "%[2]s" endpoint = "secretsmanager.us-east-2.amazonaws.com" } + tags = { + ToDelete = "ToBeDeleted" + ToUpdate = "InitialValue" + } +}`, stackName, functionName) +} + +func testAccAWSServerlessRepositoryApplicationConfig_updateUpdated(stackName, functionName string) string { + return fmt.Sprintf(` +resource "aws_serverlessrepository_application" "postgres-rotator" { + name = "%[1]s" + application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" + parameters = { + functionName = "%[2]s" + endpoint = "secretsmanager.us-east-2.amazonaws.com" + } + tags = { + ToUpdate = "UpdatedValue" + ToAdd = "AddedValue" + } }`, stackName, functionName) } @@ -159,6 +206,21 @@ resource "aws_serverlessrepository_application" "postgres-rotator" { }`, stackName, version) } +func testAccAwsServerlessRepositoryApplicationConfig_tagged(stackName string) string { + return fmt.Sprintf(` +resource "aws_serverlessrepository_application" "postgres-rotator" { + name = "%[1]s" + application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" + parameters = { + functionName = "func-%[1]s" + endpoint = "secretsmanager.us-east-2.amazonaws.com" + } + tags = { + MyTag = "My value" + } +}`, stackName) +} + func testAccCheckerverlessRepositoryApplicationExists(n string, stack *cloudformation.Stack) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] From 3c5419f401a78b5d565284a06a0d376b578c9caa Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 9 Sep 2019 22:57:58 -0700 Subject: [PATCH 21/42] Updates AWS region used to the default `us-west-2` --- aws/resource_aws_serverlessrepo_application_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aws/resource_aws_serverlessrepo_application_test.go b/aws/resource_aws_serverlessrepo_application_test.go index 019b8b825aa..d1827154d9c 100644 --- a/aws/resource_aws_serverlessrepo_application_test.go +++ b/aws/resource_aws_serverlessrepo_application_test.go @@ -28,7 +28,7 @@ func TestAccAwsServerlessRepositoryApplication_basic(t *testing.T) { resource.TestCheckResourceAttrSet("aws_serverlessrepository_application.postgres-rotator", "semantic_version"), resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.%", "2"), resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.functionName", fmt.Sprintf("func-%s", stackName)), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.endpoint", "secretsmanager.us-east-2.amazonaws.com"), + resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.endpoint", "secretsmanager.us-west-2.amazonaws.com"), resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "outputs.%", "1"), resource.TestCheckResourceAttrSet("aws_serverlessrepository_application.postgres-rotator", "outputs.RotationLambdaARN"), resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "capabilities.#", "1"), @@ -156,7 +156,7 @@ resource "aws_serverlessrepository_application" "postgres-rotator" { application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" parameters = { functionName = "func-%[1]s" - endpoint = "secretsmanager.us-east-2.amazonaws.com" + endpoint = "secretsmanager.us-west-2.amazonaws.com" } }`, stackName) } @@ -168,7 +168,7 @@ resource "aws_serverlessrepository_application" "postgres-rotator" { application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" parameters = { functionName = "%[2]s" - endpoint = "secretsmanager.us-east-2.amazonaws.com" + endpoint = "secretsmanager.us-west-2.amazonaws.com" } tags = { ToDelete = "ToBeDeleted" @@ -184,7 +184,7 @@ resource "aws_serverlessrepository_application" "postgres-rotator" { application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" parameters = { functionName = "%[2]s" - endpoint = "secretsmanager.us-east-2.amazonaws.com" + endpoint = "secretsmanager.us-west-2.amazonaws.com" } tags = { ToUpdate = "UpdatedValue" @@ -201,7 +201,7 @@ resource "aws_serverlessrepository_application" "postgres-rotator" { semantic_version = "%[2]s" parameters = { functionName = "func-%[1]s" - endpoint = "secretsmanager.us-east-2.amazonaws.com" + endpoint = "secretsmanager.us-west-2.amazonaws.com" } }`, stackName, version) } @@ -213,7 +213,7 @@ resource "aws_serverlessrepository_application" "postgres-rotator" { application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" parameters = { functionName = "func-%[1]s" - endpoint = "secretsmanager.us-east-2.amazonaws.com" + endpoint = "secretsmanager.us-west-2.amazonaws.com" } tags = { MyTag = "My value" From 70fd9942a407bb46565c12912e57de75af5f0362 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 9 Sep 2019 23:29:10 -0700 Subject: [PATCH 22/42] Renames the resource to `aws_serverlessrepository_stack` --- aws/provider.go | 2 +- ...esource_aws_serverlessrepository_stack.go} | 34 ++++---- ...ce_aws_serverlessrepository_stack_test.go} | 78 +++++++++---------- 3 files changed, 57 insertions(+), 57 deletions(-) rename aws/{resource_aws_serverlessrepo_application.go => resource_aws_serverlessrepository_stack.go} (91%) rename aws/{resource_aws_serverlessrepo_application_test.go => resource_aws_serverlessrepository_stack_test.go} (61%) diff --git a/aws/provider.go b/aws/provider.go index c1bf0b911c2..583900dcf6f 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -701,7 +701,7 @@ func Provider() terraform.ResourceProvider { "aws_securityhub_account": resourceAwsSecurityHubAccount(), "aws_securityhub_product_subscription": resourceAwsSecurityHubProductSubscription(), "aws_securityhub_standards_subscription": resourceAwsSecurityHubStandardsSubscription(), - "aws_serverlessrepository_application": resourceAwsServerlessRepositoryApplication(), + "aws_serverlessrepository_stack": resourceAwsServerlessRepositoryStack(), "aws_servicecatalog_portfolio": resourceAwsServiceCatalogPortfolio(), "aws_service_discovery_http_namespace": resourceAwsServiceDiscoveryHttpNamespace(), "aws_service_discovery_private_dns_namespace": resourceAwsServiceDiscoveryPrivateDnsNamespace(), diff --git a/aws/resource_aws_serverlessrepo_application.go b/aws/resource_aws_serverlessrepository_stack.go similarity index 91% rename from aws/resource_aws_serverlessrepo_application.go rename to aws/resource_aws_serverlessrepository_stack.go index c0050237490..6fa32c1ef72 100644 --- a/aws/resource_aws_serverlessrepo_application.go +++ b/aws/resource_aws_serverlessrepository_stack.go @@ -15,12 +15,12 @@ import ( "github.com/hashicorp/terraform/helper/schema" ) -func resourceAwsServerlessRepositoryApplication() *schema.Resource { +func resourceAwsServerlessRepositoryStack() *schema.Resource { return &schema.Resource{ - Create: resourceAwsServerlessRepositoryApplicationCreate, - Read: resourceAwsServerlessRepositoryApplicationRead, - Update: resourceAwsServerlessRepositoryApplicationUpdate, - Delete: resourceAwsServerlessRepositoryApplicationDelete, + Create: resourceAwsServerlessRepositoryStackCreate, + Read: resourceAwsServerlessRepositoryStackRead, + Update: resourceAwsServerlessRepositoryStackUpdate, + Delete: resourceAwsServerlessRepositoryStackDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, @@ -70,7 +70,7 @@ func resourceAwsServerlessRepositoryApplication() *schema.Resource { } } -func resourceAwsServerlessRepositoryApplicationCreate(d *schema.ResourceData, meta interface{}) error { +func resourceAwsServerlessRepositoryStackCreate(d *schema.ResourceData, meta interface{}) error { serverlessConn := meta.(*AWSClient).serverlessapplicationrepositoryconn cfConn := meta.(*AWSClient).cfconn @@ -83,16 +83,16 @@ func resourceAwsServerlessRepositoryApplicationCreate(d *schema.ResourceData, me changeSetRequest.SemanticVersion = aws.String(version) } if v, ok := d.GetOk("parameters"); ok { - changeSetRequest.ParameterOverrides = expandServerlessRepositoryApplicationParameters(v.(map[string]interface{})) + changeSetRequest.ParameterOverrides = expandServerlessRepositoryChangeSetParameters(v.(map[string]interface{})) } if v, ok := d.GetOk("tags"); ok { - changeSetRequest.Tags = expandServerlessRepositoryTags(v.(map[string]interface{})) + changeSetRequest.Tags = expandServerlessRepositoryChangeSetTags(v.(map[string]interface{})) } - log.Printf("[DEBUG] Creating Serverless Repo Application change set: %s", changeSetRequest) + log.Printf("[DEBUG] Creating Serverless Application Repository change set: %s", changeSetRequest) changeSetResponse, err := serverlessConn.CreateCloudFormationChangeSet(&changeSetRequest) if err != nil { - return fmt.Errorf("Creating Serverless Repo Application change set failed: %s", err.Error()) + return fmt.Errorf("Creating Serverless Application Repository change set failed: %s", err.Error()) } d.SetId(*changeSetResponse.StackId) @@ -190,10 +190,10 @@ func resourceAwsServerlessRepositoryApplicationCreate(d *schema.ResourceData, me log.Printf("[INFO] CloudFormation Stack %q created", d.Id()) - return resourceAwsServerlessRepositoryApplicationRead(d, meta) + return resourceAwsServerlessRepositoryStackRead(d, meta) } -func resourceAwsServerlessRepositoryApplicationRead(d *schema.ResourceData, meta interface{}) error { +func resourceAwsServerlessRepositoryStackRead(d *schema.ResourceData, meta interface{}) error { serverlessConn := meta.(*AWSClient).serverlessapplicationrepositoryconn cfConn := meta.(*AWSClient).cfconn @@ -275,7 +275,7 @@ func resourceAwsServerlessRepositoryApplicationRead(d *schema.ResourceData, meta return nil } -func expandServerlessRepositoryTags(tags map[string]interface{}) []*serverlessapplicationrepository.Tag { +func expandServerlessRepositoryChangeSetTags(tags map[string]interface{}) []*serverlessapplicationrepository.Tag { var cfTags []*serverlessapplicationrepository.Tag for k, v := range tags { cfTags = append(cfTags, &serverlessapplicationrepository.Tag{ @@ -308,7 +308,7 @@ func tagIgnoredServerlessRepositoryCloudFormation(k string) bool { return false } -func resourceAwsServerlessRepositoryApplicationUpdate(d *schema.ResourceData, meta interface{}) error { +func resourceAwsServerlessRepositoryStackUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).cfconn input := &cloudformation.CreateChangeSetInput{ @@ -410,10 +410,10 @@ func resourceAwsServerlessRepositoryApplicationUpdate(d *schema.ResourceData, me log.Printf("[DEBUG] CloudFormation stack %q has been updated", stackId) - return resourceAwsServerlessRepositoryApplicationRead(d, meta) + return resourceAwsServerlessRepositoryStackRead(d, meta) } -func resourceAwsServerlessRepositoryApplicationDelete(d *schema.ResourceData, meta interface{}) error { +func resourceAwsServerlessRepositoryStackDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).cfconn input := &cloudformation.DeleteStackInput{ @@ -539,7 +539,7 @@ func waitForCreateChangeSet(d *schema.ResourceData, conn *cloudformation.CloudFo } // Move to `structure.go`? -func expandServerlessRepositoryApplicationParameters(params map[string]interface{}) []*serverlessapplicationrepository.ParameterValue { +func expandServerlessRepositoryChangeSetParameters(params map[string]interface{}) []*serverlessapplicationrepository.ParameterValue { var appParams []*serverlessapplicationrepository.ParameterValue for k, v := range params { appParams = append(appParams, &serverlessapplicationrepository.ParameterValue{ diff --git a/aws/resource_aws_serverlessrepo_application_test.go b/aws/resource_aws_serverlessrepository_stack_test.go similarity index 61% rename from aws/resource_aws_serverlessrepo_application_test.go rename to aws/resource_aws_serverlessrepository_stack_test.go index d1827154d9c..bc199c0a435 100644 --- a/aws/resource_aws_serverlessrepo_application_test.go +++ b/aws/resource_aws_serverlessrepository_stack_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform/terraform" ) -func TestAccAwsServerlessRepositoryApplication_basic(t *testing.T) { +func TestAccAwsServerlessRepositoryChangeSet_basic(t *testing.T) { var stack cloudformation.Stack stackName := fmt.Sprintf("tf-acc-test-basic-%s", acctest.RandString(10)) @@ -23,17 +23,17 @@ func TestAccAwsServerlessRepositoryApplication_basic(t *testing.T) { { Config: testAccAwsServerlessRepositoryApplicationConfig(stackName), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_application.postgres-rotator", &stack), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), - resource.TestCheckResourceAttrSet("aws_serverlessrepository_application.postgres-rotator", "semantic_version"), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.%", "2"), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.functionName", fmt.Sprintf("func-%s", stackName)), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.endpoint", "secretsmanager.us-west-2.amazonaws.com"), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "outputs.%", "1"), - resource.TestCheckResourceAttrSet("aws_serverlessrepository_application.postgres-rotator", "outputs.RotationLambdaARN"), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "capabilities.#", "1"), - //resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "capabilities.0", "CAPABILITY_NAMED_IAM"), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "tags.%", "0"), + testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), + resource.TestCheckResourceAttrSet("aws_serverlessrepository_stack.postgres-rotator", "semantic_version"), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "parameters.%", "2"), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "parameters.functionName", fmt.Sprintf("func-%s", stackName)), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "parameters.endpoint", "secretsmanager.us-west-2.amazonaws.com"), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "outputs.%", "1"), + resource.TestCheckResourceAttrSet("aws_serverlessrepository_stack.postgres-rotator", "outputs.RotationLambdaARN"), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "capabilities.#", "1"), + //resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "capabilities.0", "CAPABILITY_NAMED_IAM"), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "tags.%", "0"), ), }, }, @@ -53,8 +53,8 @@ func TestAccAwsServerlessRepositoryApplication_versioned(t *testing.T) { { Config: testAccAWSServerlessRepositoryApplicationConfig_versioned(stackName, version), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_application.postgres-rotator", &stack), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "semantic_version", version), + testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "semantic_version", version), ), }, }, @@ -73,9 +73,9 @@ func TestAccAwsServerlessRepositoryApplication_tagged(t *testing.T) { { Config: testAccAwsServerlessRepositoryApplicationConfig_tagged(stackName), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_application.postgres-rotator", &stack), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "tags.MyTag", "My value"), + testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "tags.%", "1"), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "tags.MyTag", "My value"), ), }, }, @@ -96,17 +96,17 @@ func TestAccAwsServerlessRepositoryApplication_versionUpdate(t *testing.T) { { Config: testAccAWSServerlessRepositoryApplicationConfig_versioned(stackName, initialVersion), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_application.postgres-rotator", &stack), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "semantic_version", initialVersion), + testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "semantic_version", initialVersion), ), }, { Config: testAccAWSServerlessRepositoryApplicationConfig_versioned(stackName, updateVersion), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_application.postgres-rotator", &stack), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "semantic_version", updateVersion), + testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "semantic_version", updateVersion), ), }, }, @@ -127,22 +127,22 @@ func TestAccAwsServerlessRepositoryApplication_update(t *testing.T) { { Config: testAccAWSServerlessRepositoryApplicationConfig_updateInitial(stackName, initialName), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_application.postgres-rotator", &stack), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.functionName", initialName), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "tags.%", "2"), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "tags.ToDelete", "ToBeDeleted"), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "tags.ToUpdate", "InitialValue"), + testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "parameters.functionName", initialName), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "tags.%", "2"), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "tags.ToDelete", "ToBeDeleted"), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "tags.ToUpdate", "InitialValue"), ), }, { Config: testAccAWSServerlessRepositoryApplicationConfig_updateUpdated(stackName, updatedName), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_application.postgres-rotator", &stack), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "parameters.functionName", updatedName), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "tags.%", "2"), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "tags.ToUpdate", "UpdatedValue"), - resource.TestCheckResourceAttr("aws_serverlessrepository_application.postgres-rotator", "tags.ToAdd", "AddedValue"), + testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "parameters.functionName", updatedName), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "tags.%", "2"), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "tags.ToUpdate", "UpdatedValue"), + resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "tags.ToAdd", "AddedValue"), ), }, }, @@ -151,7 +151,7 @@ func TestAccAwsServerlessRepositoryApplication_update(t *testing.T) { func testAccAwsServerlessRepositoryApplicationConfig(stackName string) string { return fmt.Sprintf(` -resource "aws_serverlessrepository_application" "postgres-rotator" { +resource "aws_serverlessrepository_stack" "postgres-rotator" { name = "%[1]s" application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" parameters = { @@ -163,7 +163,7 @@ resource "aws_serverlessrepository_application" "postgres-rotator" { func testAccAWSServerlessRepositoryApplicationConfig_updateInitial(stackName, functionName string) string { return fmt.Sprintf(` -resource "aws_serverlessrepository_application" "postgres-rotator" { +resource "aws_serverlessrepository_stack" "postgres-rotator" { name = "%[1]s" application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" parameters = { @@ -179,7 +179,7 @@ resource "aws_serverlessrepository_application" "postgres-rotator" { func testAccAWSServerlessRepositoryApplicationConfig_updateUpdated(stackName, functionName string) string { return fmt.Sprintf(` -resource "aws_serverlessrepository_application" "postgres-rotator" { +resource "aws_serverlessrepository_stack" "postgres-rotator" { name = "%[1]s" application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" parameters = { @@ -195,7 +195,7 @@ resource "aws_serverlessrepository_application" "postgres-rotator" { func testAccAWSServerlessRepositoryApplicationConfig_versioned(stackName, version string) string { return fmt.Sprintf(` -resource "aws_serverlessrepository_application" "postgres-rotator" { +resource "aws_serverlessrepository_stack" "postgres-rotator" { name = "%[1]s" application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" semantic_version = "%[2]s" @@ -208,7 +208,7 @@ resource "aws_serverlessrepository_application" "postgres-rotator" { func testAccAwsServerlessRepositoryApplicationConfig_tagged(stackName string) string { return fmt.Sprintf(` -resource "aws_serverlessrepository_application" "postgres-rotator" { +resource "aws_serverlessrepository_stack" "postgres-rotator" { name = "%[1]s" application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" parameters = { From 69701fa594d4f4672db63fd0b7da22f3ee86259d Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 9 Sep 2019 23:39:15 -0700 Subject: [PATCH 23/42] Adds documentation for `aws_serverlessrepository_stack` --- .../serverlessrepository_stack.html.markdown | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 website/docs/r/serverlessrepository_stack.html.markdown diff --git a/website/docs/r/serverlessrepository_stack.html.markdown b/website/docs/r/serverlessrepository_stack.html.markdown new file mode 100644 index 00000000000..d3ca40c1862 --- /dev/null +++ b/website/docs/r/serverlessrepository_stack.html.markdown @@ -0,0 +1,47 @@ +--- +layout: "aws" +page_title: "AWS: aws_serverlessrepository_stack" +sidebar_current: "docs-aws-resource-serverlessrepository-stack" +description: |- + Provides a Serverless Application Repository Stack resource. +--- + +# Resource: aws_serverlessrepository_application + +Provides a Serverless Application Repository CloudFormation Stack resource + +## Example Usage + +```hcl +resource "aws_serverlessrepository_application" "postgres-rotator" { + name = "postgres-rotator" + application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" + parameters = { + functionName = "func-postgres-rotator" + endpoint = "secretsmanager.us-west-2.amazonaws.com" + } +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) The name of the stack to create. AWS prefixes this name with `serverlessrepo-` +* `application_id` - (Required) The ARN of the application from the Serverless Application Repository. +* `parameters` - (Optional) A map of Parameter structures that specify input parameters for the stack. +* `semantic_version` - (Optional) The version of the application to deploy. If not supplied, deploys the latest version. +* `tags` - (Optional) A list of tags to associate with this stack. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - A unique identifier of the stack. +* `outputs` - A map of outputs from the stack. +* `capabilities` - A list of capabilities. + Valid values: `CAPABILITY_IAM`, `CAPABILITY_NAMED_IAM`, or `CAPABILITY_AUTO_EXPAND` + +## Import + +Import is not yet implemented. \ No newline at end of file From 062f836550d1f4ae81b90a48b0a6ef2fcdb8fdb1 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 9 Sep 2019 23:53:23 -0700 Subject: [PATCH 24/42] Renames tests for `aws_serverlessrepository_stack` --- ...rce_aws_serverlessrepository_stack_test.go | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/aws/resource_aws_serverlessrepository_stack_test.go b/aws/resource_aws_serverlessrepository_stack_test.go index bc199c0a435..2c9e72d6561 100644 --- a/aws/resource_aws_serverlessrepository_stack_test.go +++ b/aws/resource_aws_serverlessrepository_stack_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform/terraform" ) -func TestAccAwsServerlessRepositoryChangeSet_basic(t *testing.T) { +func TestAccAwsServerlessRepositoryStack_basic(t *testing.T) { var stack cloudformation.Stack stackName := fmt.Sprintf("tf-acc-test-basic-%s", acctest.RandString(10)) @@ -21,9 +21,9 @@ func TestAccAwsServerlessRepositoryChangeSet_basic(t *testing.T) { CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsServerlessRepositoryApplicationConfig(stackName), + Config: testAccAwsServerlessRepositoryStackConfig(stackName), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + testAccCheckerverlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), resource.TestCheckResourceAttrSet("aws_serverlessrepository_stack.postgres-rotator", "semantic_version"), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "parameters.%", "2"), @@ -40,7 +40,7 @@ func TestAccAwsServerlessRepositoryChangeSet_basic(t *testing.T) { }) } -func TestAccAwsServerlessRepositoryApplication_versioned(t *testing.T) { +func TestAccAwsServerlessRepositoryStack_versioned(t *testing.T) { var stack cloudformation.Stack stackName := fmt.Sprintf("tf-acc-test-versioned-%s", acctest.RandString(10)) const version = "1.0.15" @@ -51,9 +51,9 @@ func TestAccAwsServerlessRepositoryApplication_versioned(t *testing.T) { CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSServerlessRepositoryApplicationConfig_versioned(stackName, version), + Config: testAccAWSServerlessRepositoryStackConfig_versioned(stackName, version), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + testAccCheckerverlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "semantic_version", version), ), }, @@ -61,7 +61,7 @@ func TestAccAwsServerlessRepositoryApplication_versioned(t *testing.T) { }) } -func TestAccAwsServerlessRepositoryApplication_tagged(t *testing.T) { +func TestAccAwsServerlessRepositoryStack_tagged(t *testing.T) { var stack cloudformation.Stack stackName := fmt.Sprintf("tf-acc-test-tagged-%s", acctest.RandString(10)) @@ -71,9 +71,9 @@ func TestAccAwsServerlessRepositoryApplication_tagged(t *testing.T) { CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsServerlessRepositoryApplicationConfig_tagged(stackName), + Config: testAccAwsServerlessRepositoryStackConfig_tagged(stackName), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + testAccCheckerverlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "tags.%", "1"), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "tags.MyTag", "My value"), ), @@ -82,7 +82,7 @@ func TestAccAwsServerlessRepositoryApplication_tagged(t *testing.T) { }) } -func TestAccAwsServerlessRepositoryApplication_versionUpdate(t *testing.T) { +func TestAccAwsServerlessRepositoryStack_versionUpdate(t *testing.T) { var stack cloudformation.Stack stackName := fmt.Sprintf("tf-acc-test-update-%s", acctest.RandString(10)) const initialVersion = "1.0.15" @@ -94,17 +94,17 @@ func TestAccAwsServerlessRepositoryApplication_versionUpdate(t *testing.T) { CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSServerlessRepositoryApplicationConfig_versioned(stackName, initialVersion), + Config: testAccAWSServerlessRepositoryStackConfig_versioned(stackName, initialVersion), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + testAccCheckerverlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "semantic_version", initialVersion), ), }, { - Config: testAccAWSServerlessRepositoryApplicationConfig_versioned(stackName, updateVersion), + Config: testAccAWSServerlessRepositoryStackConfig_versioned(stackName, updateVersion), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + testAccCheckerverlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "semantic_version", updateVersion), ), @@ -113,7 +113,7 @@ func TestAccAwsServerlessRepositoryApplication_versionUpdate(t *testing.T) { }) } -func TestAccAwsServerlessRepositoryApplication_update(t *testing.T) { +func TestAccAwsServerlessRepositoryStack_update(t *testing.T) { var stack cloudformation.Stack stackName := fmt.Sprintf("tf-acc-test-update-name-%s", acctest.RandString(10)) const initialName = "FuncName1" @@ -125,9 +125,9 @@ func TestAccAwsServerlessRepositoryApplication_update(t *testing.T) { CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSServerlessRepositoryApplicationConfig_updateInitial(stackName, initialName), + Config: testAccAWSServerlessRepositoryStackConfig_updateInitial(stackName, initialName), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + testAccCheckerverlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "parameters.functionName", initialName), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "tags.%", "2"), @@ -136,9 +136,9 @@ func TestAccAwsServerlessRepositoryApplication_update(t *testing.T) { ), }, { - Config: testAccAWSServerlessRepositoryApplicationConfig_updateUpdated(stackName, updatedName), + Config: testAccAWSServerlessRepositoryStackConfig_updateUpdated(stackName, updatedName), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryApplicationExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + testAccCheckerverlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "parameters.functionName", updatedName), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "tags.%", "2"), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "tags.ToUpdate", "UpdatedValue"), @@ -149,7 +149,7 @@ func TestAccAwsServerlessRepositoryApplication_update(t *testing.T) { }) } -func testAccAwsServerlessRepositoryApplicationConfig(stackName string) string { +func testAccAwsServerlessRepositoryStackConfig(stackName string) string { return fmt.Sprintf(` resource "aws_serverlessrepository_stack" "postgres-rotator" { name = "%[1]s" @@ -161,7 +161,7 @@ resource "aws_serverlessrepository_stack" "postgres-rotator" { }`, stackName) } -func testAccAWSServerlessRepositoryApplicationConfig_updateInitial(stackName, functionName string) string { +func testAccAWSServerlessRepositoryStackConfig_updateInitial(stackName, functionName string) string { return fmt.Sprintf(` resource "aws_serverlessrepository_stack" "postgres-rotator" { name = "%[1]s" @@ -177,7 +177,7 @@ resource "aws_serverlessrepository_stack" "postgres-rotator" { }`, stackName, functionName) } -func testAccAWSServerlessRepositoryApplicationConfig_updateUpdated(stackName, functionName string) string { +func testAccAWSServerlessRepositoryStackConfig_updateUpdated(stackName, functionName string) string { return fmt.Sprintf(` resource "aws_serverlessrepository_stack" "postgres-rotator" { name = "%[1]s" @@ -193,7 +193,7 @@ resource "aws_serverlessrepository_stack" "postgres-rotator" { }`, stackName, functionName) } -func testAccAWSServerlessRepositoryApplicationConfig_versioned(stackName, version string) string { +func testAccAWSServerlessRepositoryStackConfig_versioned(stackName, version string) string { return fmt.Sprintf(` resource "aws_serverlessrepository_stack" "postgres-rotator" { name = "%[1]s" @@ -206,7 +206,7 @@ resource "aws_serverlessrepository_stack" "postgres-rotator" { }`, stackName, version) } -func testAccAwsServerlessRepositoryApplicationConfig_tagged(stackName string) string { +func testAccAwsServerlessRepositoryStackConfig_tagged(stackName string) string { return fmt.Sprintf(` resource "aws_serverlessrepository_stack" "postgres-rotator" { name = "%[1]s" @@ -221,7 +221,7 @@ resource "aws_serverlessrepository_stack" "postgres-rotator" { }`, stackName) } -func testAccCheckerverlessRepositoryApplicationExists(n string, stack *cloudformation.Stack) resource.TestCheckFunc { +func testAccCheckerverlessRepositoryStackExists(n string, stack *cloudformation.Stack) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { From 507fbfb022b1fd528fbf81718057a0ecd262eca8 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 10 Sep 2019 11:35:33 -0700 Subject: [PATCH 25/42] Fixes typo in function name --- ...source_aws_serverlessrepository_stack_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/aws/resource_aws_serverlessrepository_stack_test.go b/aws/resource_aws_serverlessrepository_stack_test.go index 2c9e72d6561..6067c3866eb 100644 --- a/aws/resource_aws_serverlessrepository_stack_test.go +++ b/aws/resource_aws_serverlessrepository_stack_test.go @@ -23,7 +23,7 @@ func TestAccAwsServerlessRepositoryStack_basic(t *testing.T) { { Config: testAccAwsServerlessRepositoryStackConfig(stackName), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + testAccCheckServerlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), resource.TestCheckResourceAttrSet("aws_serverlessrepository_stack.postgres-rotator", "semantic_version"), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "parameters.%", "2"), @@ -53,7 +53,7 @@ func TestAccAwsServerlessRepositoryStack_versioned(t *testing.T) { { Config: testAccAWSServerlessRepositoryStackConfig_versioned(stackName, version), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + testAccCheckServerlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "semantic_version", version), ), }, @@ -73,7 +73,7 @@ func TestAccAwsServerlessRepositoryStack_tagged(t *testing.T) { { Config: testAccAwsServerlessRepositoryStackConfig_tagged(stackName), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + testAccCheckServerlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "tags.%", "1"), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "tags.MyTag", "My value"), ), @@ -96,7 +96,7 @@ func TestAccAwsServerlessRepositoryStack_versionUpdate(t *testing.T) { { Config: testAccAWSServerlessRepositoryStackConfig_versioned(stackName, initialVersion), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + testAccCheckServerlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "semantic_version", initialVersion), ), @@ -104,7 +104,7 @@ func TestAccAwsServerlessRepositoryStack_versionUpdate(t *testing.T) { { Config: testAccAWSServerlessRepositoryStackConfig_versioned(stackName, updateVersion), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + testAccCheckServerlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "semantic_version", updateVersion), ), @@ -127,7 +127,7 @@ func TestAccAwsServerlessRepositoryStack_update(t *testing.T) { { Config: testAccAWSServerlessRepositoryStackConfig_updateInitial(stackName, initialName), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + testAccCheckServerlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "parameters.functionName", initialName), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "tags.%", "2"), @@ -138,7 +138,7 @@ func TestAccAwsServerlessRepositoryStack_update(t *testing.T) { { Config: testAccAWSServerlessRepositoryStackConfig_updateUpdated(stackName, updatedName), Check: resource.ComposeTestCheckFunc( - testAccCheckerverlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), + testAccCheckServerlessRepositoryStackExists("aws_serverlessrepository_stack.postgres-rotator", &stack), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "parameters.functionName", updatedName), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "tags.%", "2"), resource.TestCheckResourceAttr("aws_serverlessrepository_stack.postgres-rotator", "tags.ToUpdate", "UpdatedValue"), @@ -221,7 +221,7 @@ resource "aws_serverlessrepository_stack" "postgres-rotator" { }`, stackName) } -func testAccCheckerverlessRepositoryStackExists(n string, stack *cloudformation.Stack) resource.TestCheckFunc { +func testAccCheckServerlessRepositoryStackExists(n string, stack *cloudformation.Stack) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { From 0a5feb856f04cf7650399aa81da1d48dab78af1b Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 27 Oct 2020 16:22:38 -0700 Subject: [PATCH 26/42] Fixes documentation errors --- website/allowed-subcategories.txt | 1 + ...> serverlessrepository_application.html.markdown} | 12 ++++++------ .../docs/r/serverlessrepository_stack.html.markdown | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) rename website/docs/d/{serverlessrepo_application.html.markdown => serverlessrepository_application.html.markdown} (74%) diff --git a/website/allowed-subcategories.txt b/website/allowed-subcategories.txt index f3ba934b964..82cb5943e07 100644 --- a/website/allowed-subcategories.txt +++ b/website/allowed-subcategories.txt @@ -106,6 +106,7 @@ SWF Sagemaker Secrets Manager Security Hub +Serverless Application Repository Service Catalog Service Discovery Service Quotas diff --git a/website/docs/d/serverlessrepo_application.html.markdown b/website/docs/d/serverlessrepository_application.html.markdown similarity index 74% rename from website/docs/d/serverlessrepo_application.html.markdown rename to website/docs/d/serverlessrepository_application.html.markdown index 037713fd6cf..9496350854a 100644 --- a/website/docs/d/serverlessrepo_application.html.markdown +++ b/website/docs/d/serverlessrepository_application.html.markdown @@ -1,19 +1,19 @@ --- +subcategory: "Serverless Application Repository" layout: "aws" -page_title: "AWS: aws_serverlessrepo_application" -sidebar_current: "docs-aws-datasource-serverlessrepo-application" +page_title: "AWS: aws_serverlessrepository_application" description: |- Get information on a AWS Serverless Application Repository application --- -# Data Source: aws_serverlessrepo_application +# Data Source: aws_serverlessrepository_application Use this data source to get the source code URL and template URL of an AWS Serverless Application Repository application. ## Example Usage ```hcl -data "aws_serverlessrepo_application" "example" { +data "aws_serverlessrepository_application" "example" { application_id = "arn:aws:serverlessrepo:us-east-1:123456789012:applications/ExampleApplication" } @@ -22,7 +22,7 @@ resource "aws_cloudformation_stack" "example" { capabilities = ["CAPABILITY_NAMED_IAM"] - template_url = data.aws_serverlessrepo_application.example.template_url + template_url = data.aws_serverlessrepository_application.example.template_url } ``` @@ -30,7 +30,7 @@ resource "aws_cloudformation_stack" "example" { ## Argument Reference * `application_id` - (Required) The ARN of the application. -* `semantic_version` - (Optional) The requested version of the application. By default, uses the latest version. +* `semantic_version` - (Optional) The requested version of the application. By default, retrieves the latest version. ## Attributes Reference diff --git a/website/docs/r/serverlessrepository_stack.html.markdown b/website/docs/r/serverlessrepository_stack.html.markdown index b6b0941bf3a..dd23818114b 100644 --- a/website/docs/r/serverlessrepository_stack.html.markdown +++ b/website/docs/r/serverlessrepository_stack.html.markdown @@ -1,7 +1,7 @@ --- +subcategory: "Serverless Application Repository" layout: "aws" page_title: "AWS: aws_serverlessrepository_stack" -sidebar_current: "docs-aws-resource-serverlessrepository-stack" description: |- Provides a Serverless Application Repository Stack resource. --- @@ -30,7 +30,7 @@ The following arguments are supported: * `name` - (Required) The name of the stack to create. AWS prefixes this name with `serverlessrepo-` * `application_id` - (Required) The ARN of the application from the Serverless Application Repository. * `capabilities` - A list of capabilities. - Valid values: `CAPABILITY_IAM`, `CAPABILITY_NAMED_IAM`, `CAPABILITY_RESOURCE_POLICY`, or `CAPABILITY_AUTO_EXPAND` + Valid values: `CAPABILITY_IAM`, `CAPABILITY_NAMED_IAM`, or `CAPABILITY_AUTO_EXPAND` * `parameters` - (Optional) A map of Parameter structures that specify input parameters for the stack. * `semantic_version` - (Optional) The version of the application to deploy. If not supplied, deploys the latest version. * `tags` - (Optional) A list of tags to associate with this stack. From ef3f4a7ba441b6ddce28363c4d915b58e5913efc Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 30 Oct 2020 16:42:26 -0700 Subject: [PATCH 27/42] Adds `required_capabilities` to Serverless Application Repository application data source --- ...ce_aws_serverlessrepository_application.go | 13 +++++++-- ...s_serverlessrepository_application_test.go | 29 +++++++++++++++---- ...erlessrepository_application.html.markdown | 4 +-- 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/aws/data_source_aws_serverlessrepository_application.go b/aws/data_source_aws_serverlessrepository_application.go index 93090f42de9..33d8c40dcd5 100644 --- a/aws/data_source_aws_serverlessrepository_application.go +++ b/aws/data_source_aws_serverlessrepository_application.go @@ -28,6 +28,12 @@ func dataSourceAwsServerlessRepositoryApplication() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "required_capabilities": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, "source_code_url": { Type: schema.TypeString, Computed: true, @@ -53,11 +59,11 @@ func dataSourceAwsServerlessRepositoryApplicationRead(d *schema.ResourceData, me version := v.(string) input.SemanticVersion = aws.String(version) } - log.Printf("[DEBUG] Reading Serverless Repo Application with request: %s", input) + log.Printf("[DEBUG] Reading Serverless Application Repository application with request: %s", input) output, err := conn.GetApplication(input) if err != nil { - return fmt.Errorf("error reading application: %w", err) + return fmt.Errorf("error reading Serverless Application Repository application (%s): %w", applicationID, err) } d.SetId(applicationID) @@ -65,6 +71,9 @@ func dataSourceAwsServerlessRepositoryApplicationRead(d *schema.ResourceData, me d.Set("semantic_version", output.Version.SemanticVersion) d.Set("source_code_url", output.Version.SourceCodeUrl) d.Set("template_url", output.Version.TemplateUrl) + if err = d.Set("required_capabilities", flattenStringSet(output.Version.RequiredCapabilities)); err != nil { + return fmt.Errorf("failed to set required_capabilities: %w", err) + } return nil } diff --git a/aws/data_source_aws_serverlessrepository_application_test.go b/aws/data_source_aws_serverlessrepository_application_test.go index 1f72f4b18db..d6b314f38e3 100644 --- a/aws/data_source_aws_serverlessrepository_application_test.go +++ b/aws/data_source_aws_serverlessrepository_application_test.go @@ -7,6 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfawsresource" ) func TestAccDataSourceAwsServerlessRepositoryApplication_Basic(t *testing.T) { @@ -24,11 +25,12 @@ func TestAccDataSourceAwsServerlessRepositoryApplication_Basic(t *testing.T) { resource.TestCheckResourceAttrSet(datasourceName, "semantic_version"), resource.TestCheckResourceAttrSet(datasourceName, "source_code_url"), resource.TestCheckResourceAttrSet(datasourceName, "template_url"), + resource.TestCheckResourceAttrSet(datasourceName, "required_capabilities.#"), ), }, { Config: testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_NonExistent, - ExpectError: regexp.MustCompile(`error reading application`), + ExpectError: regexp.MustCompile(`error reading Serverless Application Repository application`), }, }, }) @@ -36,25 +38,42 @@ func TestAccDataSourceAwsServerlessRepositoryApplication_Basic(t *testing.T) { func TestAccDataSourceAwsServerlessRepositoryApplication_Versioned(t *testing.T) { datasourceName := "data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator" - const version = "1.0.15" + const ( + version1 = "1.0.15" + version2 = "1.1.78" + ) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_Versioned(version), + Config: testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_Versioned(version1), Check: resource.ComposeTestCheckFunc( testAccCheckAwsServerlessRepositoryApplicationDataSourceID(datasourceName), resource.TestCheckResourceAttr(datasourceName, "name", "SecretsManagerRDSPostgreSQLRotationSingleUser"), - resource.TestCheckResourceAttr(datasourceName, "semantic_version", version), + resource.TestCheckResourceAttr(datasourceName, "semantic_version", version1), resource.TestCheckResourceAttrSet(datasourceName, "source_code_url"), resource.TestCheckResourceAttrSet(datasourceName, "template_url"), + resource.TestCheckResourceAttr(datasourceName, "required_capabilities.#", "0"), + ), + }, + { + Config: testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_Versioned(version2), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsServerlessRepositoryApplicationDataSourceID(datasourceName), + resource.TestCheckResourceAttr(datasourceName, "name", "SecretsManagerRDSPostgreSQLRotationSingleUser"), + resource.TestCheckResourceAttr(datasourceName, "semantic_version", version2), + resource.TestCheckResourceAttrSet(datasourceName, "source_code_url"), + resource.TestCheckResourceAttrSet(datasourceName, "template_url"), + resource.TestCheckResourceAttr(datasourceName, "required_capabilities.#", "2"), + tfawsresource.TestCheckTypeSetElemAttr(datasourceName, "required_capabilities.*", "CAPABILITY_IAM"), + tfawsresource.TestCheckTypeSetElemAttr(datasourceName, "required_capabilities.*", "CAPABILITY_RESOURCE_POLICY"), ), }, { Config: testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_Versioned_NonExistent, - ExpectError: regexp.MustCompile(`error reading application`), + ExpectError: regexp.MustCompile(`error reading Serverless Application Repository application`), }, }, }) diff --git a/website/docs/d/serverlessrepository_application.html.markdown b/website/docs/d/serverlessrepository_application.html.markdown index 9496350854a..4825abeb17c 100644 --- a/website/docs/d/serverlessrepository_application.html.markdown +++ b/website/docs/d/serverlessrepository_application.html.markdown @@ -20,11 +20,10 @@ data "aws_serverlessrepository_application" "example" { resource "aws_cloudformation_stack" "example" { name = "Example" - capabilities = ["CAPABILITY_NAMED_IAM"] + capabilities = data.aws_serverlessrepository_application.example.required_capabilities template_url = data.aws_serverlessrepository_application.example.template_url } - ``` ## Argument Reference @@ -37,5 +36,6 @@ resource "aws_cloudformation_stack" "example" { * `application_id` - The ARN of the application. * `semantic_version` - The version of the application retrieved. * `name` - The name of the application. +* `required_capabilities` - A list of capabilities describing the permissions needed to deploy the application. * `source_code_url` - A URL pointing to the source code of the application version. * `template_url` - A URL pointing to the Cloud Formation template for the application version. From ae96e4f0bba77aef1317ff308c88c78f7ff16529 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 2 Nov 2020 12:19:27 -0800 Subject: [PATCH 28/42] Adds support for CAPABILITY_RESOURCE_POLICY capability --- ...ce_aws_serverlessrepository_application.go | 4 +- ...resource_aws_serverlessrepository_stack.go | 75 +++-- ...rce_aws_serverlessrepository_stack_test.go | 273 +++++++++++++----- .../serverlessrepository_stack.html.markdown | 15 +- 4 files changed, 257 insertions(+), 110 deletions(-) diff --git a/aws/data_source_aws_serverlessrepository_application.go b/aws/data_source_aws_serverlessrepository_application.go index 33d8c40dcd5..6034e2cbb6e 100644 --- a/aws/data_source_aws_serverlessrepository_application.go +++ b/aws/data_source_aws_serverlessrepository_application.go @@ -5,7 +5,7 @@ import ( "log" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/serverlessapplicationrepository" + serverlessrepository "github.com/aws/aws-sdk-go/service/serverlessapplicationrepository" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -51,7 +51,7 @@ func dataSourceAwsServerlessRepositoryApplicationRead(d *schema.ResourceData, me applicationID := d.Get("application_id").(string) - input := &serverlessapplicationrepository.GetApplicationInput{ + input := &serverlessrepository.GetApplicationInput{ ApplicationId: aws.String(applicationID), } diff --git a/aws/resource_aws_serverlessrepository_stack.go b/aws/resource_aws_serverlessrepository_stack.go index ea1fc27bbe4..ea96e8f1c24 100644 --- a/aws/resource_aws_serverlessrepository_stack.go +++ b/aws/resource_aws_serverlessrepository_stack.go @@ -50,11 +50,8 @@ func resourceAwsServerlessRepositoryStack() *schema.Resource { Optional: true, Computed: true, Elem: &schema.Schema{ - Type: schema.TypeString, - // Use the CloudFormation values, since the Serverless Application Repo set includes - // one additional value that will only be useable on creation and does not cause problems - // if set at all times - ValidateFunc: validation.StringInSlice(cloudformation.Capability_Values(), false), + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice(serverlessrepository.Capability_Values(), false), }, Set: schema.HashString, }, @@ -88,12 +85,8 @@ func resourceAwsServerlessRepositoryStackCreate(d *schema.ResourceData, meta int changeSetRequest := serverlessrepository.CreateCloudFormationChangeSetRequest{ StackName: aws.String(stackName), ApplicationId: aws.String(d.Get("application_id").(string)), - // Always add "CAPABILITY_RESOURCE_POLICY" here - Capabilities: append( - expandStringSet(d.Get("capabilities").(*schema.Set)), - aws.String(serverlessrepository.CapabilityCapabilityResourcePolicy), - ), - Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreServerlessApplicationRepository().ServerlessapplicationrepositoryTags(), + Capabilities: expandStringSet(d.Get("capabilities").(*schema.Set)), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreServerlessApplicationRepository().ServerlessapplicationrepositoryTags(), } if v, ok := d.GetOk("semantic_version"); ok { version := v.(string) @@ -183,7 +176,7 @@ func resourceAwsServerlessRepositoryStackCreate(d *schema.ResourceData, meta int return fmt.Errorf("Failed getting rollback reasons: %w", err) } - return fmt.Errorf("%s: %q", lastStatus, reasons) + return fmt.Errorf("Error creating %s: %q", lastStatus, reasons) } if lastStatus == "DELETE_COMPLETE" || lastStatus == "DELETE_FAILED" { reasons, err := getCloudFormationDeletionReasons(d.Id(), cfConn) @@ -192,14 +185,14 @@ func resourceAwsServerlessRepositoryStackCreate(d *schema.ResourceData, meta int } d.SetId("") - return fmt.Errorf("%s: %q", lastStatus, reasons) + return fmt.Errorf("Error creating %s: %q", lastStatus, reasons) } if lastStatus == "CREATE_FAILED" { reasons, err := getCloudFormationFailures(d.Id(), cfConn) if err != nil { return fmt.Errorf("Failed getting failure reasons: %w", err) } - return fmt.Errorf("%s: %q", lastStatus, reasons) + return fmt.Errorf("Error creating %s: %q", lastStatus, reasons) } log.Printf("[INFO] CloudFormation Stack %q created", d.Id()) @@ -266,21 +259,19 @@ func resourceAwsServerlessRepositoryStackRead(d *schema.ResourceData, meta inter originalParams := d.Get("parameters").(map[string]interface{}) if err = d.Set("parameters", flattenCloudFormationParameters(stack.Parameters, originalParams)); err != nil { - return err + return fmt.Errorf("failed to set parameters: %w", err) } if err = d.Set("tags", keyvaluetags.CloudformationKeyValueTags(stack.Tags).IgnoreServerlessApplicationRepository().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return err + return fmt.Errorf("failed to set tags: %w", err) } if err = d.Set("outputs", flattenCloudFormationOutputs(stack.Outputs)); err != nil { - return err + return fmt.Errorf("failed to set outputs: %w", err) } - if len(stack.Capabilities) > 0 { - if err = d.Set("capabilities", flattenStringSet(stack.Capabilities)); err != nil { - return err - } + if err = d.Set("capabilities", flattenServerlessRepositoryStackCapabilities(d, stack.Capabilities)); err != nil { + return fmt.Errorf("failed to set capabilities: %w", err) } return nil @@ -295,21 +286,20 @@ func resourceAwsServerlessRepositoryStackUpdate(d *schema.ResourceData, meta int ChangeSetType: aws.String("UPDATE"), } - input.ChangeSetName = aws.String(fmt.Sprintf("%s-%s", - d.Get("name").(string), - time.Now().UTC().Format("20060102150405999999999"))) + input.ChangeSetName = aws.String(resource.PrefixedUniqueId(d.Get("name").(string))) // Parameters must be present whether they are changed or not if v, ok := d.GetOk("parameters"); ok { input.Parameters = expandCloudFormationParameters(v.(map[string]interface{})) } - if v, ok := d.GetOk("tags"); ok { - input.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreServerlessApplicationRepository().CloudformationTags() + if d.HasChange("tags") { + if v, ok := d.GetOk("tags"); ok { + input.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreServerlessApplicationRepository().CloudformationTags() + } } - capabilities := d.Get("capabilities") - input.Capabilities = expandStringSet(capabilities.(*schema.Set)) + input.Capabilities = expandServerlessRepositoryStackChangeSetCapabilities(d.Get("capabilities").(*schema.Set)) log.Printf("[DEBUG] Creating CloudFormation change set: %s", input) changeSetResponse, err := conn.CreateChangeSet(input) @@ -383,7 +373,7 @@ func resourceAwsServerlessRepositoryStackUpdate(d *schema.ResourceData, meta int return fmt.Errorf("Failed getting details about rollback: %w", err) } - return fmt.Errorf("%s: %q", lastStatus, reasons) + return fmt.Errorf("Error updating %s: %q", lastStatus, reasons) } log.Printf("[DEBUG] CloudFormation stack %q has been updated", stackID) @@ -467,7 +457,7 @@ func resourceAwsServerlessRepositoryStackDelete(d *schema.ResourceData, meta int return fmt.Errorf("Failed getting reasons of failure: %w", err) } - return fmt.Errorf("%s: %q", lastStatus, reasons) + return fmt.Errorf("Error deleting %s: %q", lastStatus, reasons) } log.Printf("[DEBUG] CloudFormation stack %q has been deleted", d.Id()) @@ -511,7 +501,7 @@ func waitForCreateChangeSet(d *schema.ResourceData, conn *cloudformation.CloudFo if err != nil { return fmt.Errorf("Failed getting failure reasons: %w", err) } - return fmt.Errorf("%s: %q", lastChangeSetStatus, reasons) + return fmt.Errorf("Error waiting %s: %q", lastChangeSetStatus, reasons) } return err } @@ -526,3 +516,26 @@ func expandServerlessRepositoryChangeSetParameters(params map[string]interface{} } return appParams } + +func flattenServerlessRepositoryStackCapabilities(d *schema.ResourceData, c []*string) *schema.Set { + // We need to preserve "CAPABILITY_RESOURCE_POLICY" if it has been set. It is not + // returned by the CloudFormation APIs. + existingCapabilities := d.Get("capabilities").(*schema.Set) + capabilities := flattenStringSet(c) + if existingCapabilities.Contains(serverlessrepository.CapabilityCapabilityResourcePolicy) { + capabilities.Add(serverlessrepository.CapabilityCapabilityResourcePolicy) + } + return capabilities +} + +func expandServerlessRepositoryStackChangeSetCapabilities(capabilities *schema.Set) []*string { + // Filter the capabilities for the CloudFormation Change Set. CloudFormation supports a + // subset of the capabilities supported by Serverless Application Repository. + result := make([]*string, 0, capabilities.Len()) + for _, c := range cloudformation.Capability_Values() { + if capabilities.Contains(c) { + result = append(result, aws.String(c)) + } + } + return result +} diff --git a/aws/resource_aws_serverlessrepository_stack_test.go b/aws/resource_aws_serverlessrepository_stack_test.go index 631e644b711..ed4b1612eed 100644 --- a/aws/resource_aws_serverlessrepository_stack_test.go +++ b/aws/resource_aws_serverlessrepository_stack_test.go @@ -14,7 +14,7 @@ import ( func TestAccAwsServerlessRepositoryStack_basic(t *testing.T) { var stack cloudformation.Stack - stackName := acctest.RandomWithPrefix("tf-acc-test-basic") + stackName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_serverlessrepository_stack.postgres-rotator" @@ -31,11 +31,12 @@ func TestAccAwsServerlessRepositoryStack_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "semantic_version"), resource.TestCheckResourceAttr(resourceName, "parameters.%", "2"), resource.TestCheckResourceAttr(resourceName, "parameters.functionName", fmt.Sprintf("func-%s", stackName)), - resource.TestCheckResourceAttr(resourceName, "parameters.endpoint", "secretsmanager.us-west-2.amazonaws.com"), + resource.TestCheckResourceAttr(resourceName, "parameters.endpoint", "secretsmanager.us-west-2.amazonaws.com"), // FIXME resource.TestCheckResourceAttr(resourceName, "outputs.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "outputs.RotationLambdaARN"), - resource.TestCheckResourceAttr(resourceName, "capabilities.#", "1"), + resource.TestCheckResourceAttr(resourceName, "capabilities.#", "2"), tfawsresource.TestCheckTypeSetElemAttr(resourceName, "capabilities.*", "CAPABILITY_IAM"), + tfawsresource.TestCheckTypeSetElemAttr(resourceName, "capabilities.*", "CAPABILITY_RESOURCE_POLICY"), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, @@ -45,8 +46,12 @@ func TestAccAwsServerlessRepositoryStack_basic(t *testing.T) { func TestAccAwsServerlessRepositoryStack_versioned(t *testing.T) { var stack cloudformation.Stack - stackName := acctest.RandomWithPrefix("tf-acc-test-versioned") - const version = "1.0.15" + stackName := acctest.RandomWithPrefix("tf-acc-test") + + const ( + version1 = "1.0.15" + version2 = "1.1.78" + ) resourceName := "aws_serverlessrepository_stack.postgres-rotator" @@ -56,19 +61,43 @@ func TestAccAwsServerlessRepositoryStack_versioned(t *testing.T) { CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSServerlessRepositoryStackConfig_versioned(stackName, version), + Config: testAccAWSServerlessRepositoryStackConfig_versioned(stackName, version1), Check: resource.ComposeTestCheckFunc( testAccCheckServerlessRepositoryStackExists(resourceName, &stack), - resource.TestCheckResourceAttr(resourceName, "semantic_version", version), + resource.TestCheckResourceAttr(resourceName, "semantic_version", version1), + resource.TestCheckResourceAttr(resourceName, "capabilities.#", "1"), + tfawsresource.TestCheckTypeSetElemAttr(resourceName, "capabilities.*", "CAPABILITY_IAM"), + ), + }, + { + Config: testAccAWSServerlessRepositoryStackConfig_versioned2(stackName, version2), + Check: resource.ComposeTestCheckFunc( + testAccCheckServerlessRepositoryStackExists(resourceName, &stack), + resource.TestCheckResourceAttr(resourceName, "semantic_version", version2), + resource.TestCheckResourceAttr(resourceName, "capabilities.#", "2"), + tfawsresource.TestCheckTypeSetElemAttr(resourceName, "capabilities.*", "CAPABILITY_IAM"), + tfawsresource.TestCheckTypeSetElemAttr(resourceName, "capabilities.*", "CAPABILITY_RESOURCE_POLICY"), + ), + }, + { + // Confirm removal of "CAPABILITY_RESOURCE_POLICY" is handled properly + Config: testAccAWSServerlessRepositoryStackConfig_versioned(stackName, version1), + Check: resource.ComposeTestCheckFunc( + testAccCheckServerlessRepositoryStackExists(resourceName, &stack), + resource.TestCheckResourceAttr(resourceName, "semantic_version", version1), + resource.TestCheckResourceAttr(resourceName, "capabilities.#", "1"), + tfawsresource.TestCheckTypeSetElemAttr(resourceName, "capabilities.*", "CAPABILITY_IAM"), ), }, }, }) } -func TestAccAwsServerlessRepositoryStack_tagged(t *testing.T) { +func TestAccAwsServerlessRepositoryStack_paired(t *testing.T) { var stack cloudformation.Stack - stackName := acctest.RandomWithPrefix("tf-acc-test-tagged") + stackName := acctest.RandomWithPrefix("tf-acc-test") + + const version = "1.1.78" resourceName := "aws_serverlessrepository_stack.postgres-rotator" @@ -78,22 +107,22 @@ func TestAccAwsServerlessRepositoryStack_tagged(t *testing.T) { CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsServerlessRepositoryStackConfig_tagged(stackName), + Config: testAccAWSServerlessRepositoryStackConfig_versionedPaired(stackName, version), Check: resource.ComposeTestCheckFunc( testAccCheckServerlessRepositoryStackExists(resourceName, &stack), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.MyTag", "My value"), + resource.TestCheckResourceAttr(resourceName, "semantic_version", version), + resource.TestCheckResourceAttr(resourceName, "capabilities.#", "2"), + tfawsresource.TestCheckTypeSetElemAttr(resourceName, "capabilities.*", "CAPABILITY_IAM"), + tfawsresource.TestCheckTypeSetElemAttr(resourceName, "capabilities.*", "CAPABILITY_RESOURCE_POLICY"), ), }, }, }) } -func TestAccAwsServerlessRepositoryStack_versionUpdate(t *testing.T) { +func TestAccAwsServerlessRepositoryStack_Tags(t *testing.T) { var stack cloudformation.Stack - stackName := acctest.RandomWithPrefix("tf-acc-test-update") - const initialVersion = "1.0.15" - const updateVersion = "1.0.36" + stackName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_serverlessrepository_stack.postgres-rotator" @@ -103,19 +132,27 @@ func TestAccAwsServerlessRepositoryStack_versionUpdate(t *testing.T) { CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSServerlessRepositoryStackConfig_versioned(stackName, initialVersion), + Config: testAccAwsServerlessRepositoryStackConfigTags1(stackName, "key1", "value1"), Check: resource.ComposeTestCheckFunc( testAccCheckServerlessRepositoryStackExists(resourceName, &stack), - resource.TestCheckResourceAttr(resourceName, "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), - resource.TestCheckResourceAttr(resourceName, "semantic_version", initialVersion), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), ), }, { - Config: testAccAWSServerlessRepositoryStackConfig_versioned(stackName, updateVersion), + Config: testAccAwsServerlessRepositoryStackConfigTags2(stackName, "key1", "value1updated", "key2", "value2"), Check: resource.ComposeTestCheckFunc( testAccCheckServerlessRepositoryStackExists(resourceName, &stack), - resource.TestCheckResourceAttr(resourceName, "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), - resource.TestCheckResourceAttr(resourceName, "semantic_version", updateVersion), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAwsServerlessRepositoryStackConfigTags1(stackName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckServerlessRepositoryStackExists(resourceName, &stack), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, }, @@ -124,9 +161,9 @@ func TestAccAwsServerlessRepositoryStack_versionUpdate(t *testing.T) { func TestAccAwsServerlessRepositoryStack_update(t *testing.T) { var stack cloudformation.Stack - stackName := acctest.RandomWithPrefix("tf-acc-test-update-name") - const initialName = "FuncName1" - const updatedName = "FuncName2" + stackName := acctest.RandomWithPrefix("tf-acc-test") + initialName := acctest.RandomWithPrefix("FuncName1") + updatedName := acctest.RandomWithPrefix("FuncName2") resourceName := "aws_serverlessrepository_stack.postgres-rotator" @@ -141,9 +178,8 @@ func TestAccAwsServerlessRepositoryStack_update(t *testing.T) { testAccCheckServerlessRepositoryStackExists(resourceName, &stack), resource.TestCheckResourceAttr(resourceName, "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), resource.TestCheckResourceAttr(resourceName, "parameters.functionName", initialName), - resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), - resource.TestCheckResourceAttr(resourceName, "tags.ToDelete", "ToBeDeleted"), - resource.TestCheckResourceAttr(resourceName, "tags.ToUpdate", "InitialValue"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key", "value"), ), }, { @@ -151,26 +187,57 @@ func TestAccAwsServerlessRepositoryStack_update(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckServerlessRepositoryStackExists(resourceName, &stack), resource.TestCheckResourceAttr(resourceName, "parameters.functionName", updatedName), - resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), - resource.TestCheckResourceAttr(resourceName, "tags.ToUpdate", "UpdatedValue"), - resource.TestCheckResourceAttr(resourceName, "tags.ToAdd", "AddedValue"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key", "value"), ), }, }, }) } +func testAccCheckServerlessRepositoryStackExists(n string, stack *cloudformation.Stack) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + conn := testAccProvider.Meta().(*AWSClient).cfconn + params := &cloudformation.DescribeStacksInput{ + StackName: aws.String(rs.Primary.ID), + } + resp, err := conn.DescribeStacks(params) + if err != nil { + return err + } + if len(resp.Stacks) == 0 { + return fmt.Errorf("CloudFormation stack (%s) not found", rs.Primary.ID) + } + + *stack = *resp.Stacks[0] + + return nil + } +} + func testAccAwsServerlessRepositoryStackConfig(stackName string) string { return fmt.Sprintf(` resource "aws_serverlessrepository_stack" "postgres-rotator" { name = "%[1]s" application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" - capabilities = ["CAPABILITY_IAM"] + capabilities = [ + "CAPABILITY_IAM", + "CAPABILITY_RESOURCE_POLICY", + ] parameters = { functionName = "func-%[1]s" - endpoint = "secretsmanager.us-west-2.amazonaws.com" + endpoint = "secretsmanager.${data.aws_region.current.name}.${data.aws_partition.current.dns_suffix}" } -}`, stackName) +} + +data "aws_partition" "current" {} +data "aws_region" "current" {} +`, stackName) } func testAccAWSServerlessRepositoryStackConfig_updateInitial(stackName, functionName string) string { @@ -178,16 +245,22 @@ func testAccAWSServerlessRepositoryStackConfig_updateInitial(stackName, function resource "aws_serverlessrepository_stack" "postgres-rotator" { name = "%[1]s" application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" - capabilities = ["CAPABILITY_IAM"] + capabilities = [ + "CAPABILITY_IAM", + "CAPABILITY_RESOURCE_POLICY", + ] parameters = { functionName = "%[2]s" - endpoint = "secretsmanager.us-west-2.amazonaws.com" + endpoint = "secretsmanager.${data.aws_region.current.name}.${data.aws_partition.current.dns_suffix}" } tags = { - ToDelete = "ToBeDeleted" - ToUpdate = "InitialValue" + key = "value" } -}`, stackName, functionName) +} + +data "aws_partition" "current" {} +data "aws_region" "current" {} +`, stackName, functionName) } func testAccAWSServerlessRepositoryStackConfig_updateUpdated(stackName, functionName string) string { @@ -195,16 +268,22 @@ func testAccAWSServerlessRepositoryStackConfig_updateUpdated(stackName, function resource "aws_serverlessrepository_stack" "postgres-rotator" { name = "%[1]s" application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" - capabilities = ["CAPABILITY_IAM"] + capabilities = [ + "CAPABILITY_IAM", + "CAPABILITY_RESOURCE_POLICY", + ] parameters = { functionName = "%[2]s" - endpoint = "secretsmanager.us-west-2.amazonaws.com" + endpoint = "secretsmanager.${data.aws_region.current.name}.${data.aws_partition.current.dns_suffix}" } tags = { - ToUpdate = "UpdatedValue" - ToAdd = "AddedValue" + key = "value" } -}`, stackName, functionName) +} + +data "aws_partition" "current" {} +data "aws_region" "current" {} +`, stackName, functionName) } func testAccAWSServerlessRepositoryStackConfig_versioned(stackName, version string) string { @@ -215,50 +294,102 @@ resource "aws_serverlessrepository_stack" "postgres-rotator" { semantic_version = "%[2]s" parameters = { functionName = "func-%[1]s" - endpoint = "secretsmanager.us-west-2.amazonaws.com" + endpoint = "secretsmanager.${data.aws_region.current.name}.${data.aws_partition.current.dns_suffix}" } -}`, stackName, version) } -func testAccAwsServerlessRepositoryStackConfig_tagged(stackName string) string { +data "aws_partition" "current" {} +data "aws_region" "current" {} +`, stackName, version) +} + +func testAccAWSServerlessRepositoryStackConfig_versioned2(stackName, version string) string { return fmt.Sprintf(` resource "aws_serverlessrepository_stack" "postgres-rotator" { name = "%[1]s" application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" capabilities = [ "CAPABILITY_IAM", + "CAPABILITY_RESOURCE_POLICY", ] + semantic_version = "%[2]s" parameters = { functionName = "func-%[1]s" - endpoint = "secretsmanager.us-west-2.amazonaws.com" + endpoint = "secretsmanager.${data.aws_region.current.name}.${data.aws_partition.current.dns_suffix}" } - tags = { - MyTag = "My value" +} + +data "aws_partition" "current" {} +data "aws_region" "current" {} +`, stackName, version) +} + +func testAccAWSServerlessRepositoryStackConfig_versionedPaired(stackName, version string) string { + return fmt.Sprintf(` +resource "aws_serverlessrepository_stack" "postgres-rotator" { + name = "%[1]s" + application_id = data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator.application_id + semantic_version = data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator.semantic_version + capabilities = data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator.required_capabilities + parameters = { + functionName = "func-%[1]s" + endpoint = "secretsmanager.${data.aws_region.current.name}.${data.aws_partition.current.dns_suffix}" } -}`, stackName) } -func testAccCheckServerlessRepositoryStackExists(n string, stack *cloudformation.Stack) resource.TestCheckFunc { - return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[n] - if !ok { - return fmt.Errorf("Not found: %s", n) - } +data "aws_serverlessrepository_application" "secrets_manager_postgres_single_user_rotator" { + application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" + semantic_version = "%[2]s" +} - conn := testAccProvider.Meta().(*AWSClient).cfconn - params := &cloudformation.DescribeStacksInput{ - StackName: aws.String(rs.Primary.ID), - } - resp, err := conn.DescribeStacks(params) - if err != nil { - return err - } - if len(resp.Stacks) == 0 { - return fmt.Errorf("CloudFormation stack (%s) not found", rs.Primary.ID) - } +data "aws_partition" "current" {} +data "aws_region" "current" {} +`, stackName, version) +} - *stack = *resp.Stacks[0] +func testAccAwsServerlessRepositoryStackConfigTags1(rName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_serverlessrepository_stack" "postgres-rotator" { + name = "%[1]s" + application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" + capabilities = [ + "CAPABILITY_IAM", + "CAPABILITY_RESOURCE_POLICY", + ] + parameters = { + functionName = "func-%[1]s" + endpoint = "secretsmanager.${data.aws_region.current.name}.${data.aws_partition.current.dns_suffix}" + } + tags = { + %[2]q = %[3]q + } +} - return nil - } +data "aws_partition" "current" {} +data "aws_region" "current" {} +`, rName, tagKey1, tagValue1) +} + +func testAccAwsServerlessRepositoryStackConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_serverlessrepository_stack" "postgres-rotator" { + name = "%[1]s" + application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" + capabilities = [ + "CAPABILITY_IAM", + "CAPABILITY_RESOURCE_POLICY", + ] + parameters = { + functionName = "func-%[1]s" + endpoint = "secretsmanager.${data.aws_region.current.name}.${data.aws_partition.current.dns_suffix}" + } + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} + +data "aws_partition" "current" {} +data "aws_region" "current" {} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) } diff --git a/website/docs/r/serverlessrepository_stack.html.markdown b/website/docs/r/serverlessrepository_stack.html.markdown index dd23818114b..ea9535f2aec 100644 --- a/website/docs/r/serverlessrepository_stack.html.markdown +++ b/website/docs/r/serverlessrepository_stack.html.markdown @@ -16,11 +16,18 @@ Provides a Serverless Application Repository CloudFormation Stack resource resource "aws_serverlessrepository_application" "postgres-rotator" { name = "postgres-rotator" application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" + capabilities = [ + "CAPABILITY_IAM", + "CAPABILITY_RESOURCE_POLICY", + ] parameters = { functionName = "func-postgres-rotator" - endpoint = "secretsmanager.us-west-2.amazonaws.com" + endpoint = "secretsmanager.${data.aws_region.current.name}.${data.aws_partition.current.dns_suffix}" } } + +data "aws_partition" "current" {} +data "aws_region" "current" {} ``` ## Argument Reference @@ -30,7 +37,7 @@ The following arguments are supported: * `name` - (Required) The name of the stack to create. AWS prefixes this name with `serverlessrepo-` * `application_id` - (Required) The ARN of the application from the Serverless Application Repository. * `capabilities` - A list of capabilities. - Valid values: `CAPABILITY_IAM`, `CAPABILITY_NAMED_IAM`, or `CAPABILITY_AUTO_EXPAND` + Valid values: `CAPABILITY_IAM`, `CAPABILITY_NAMED_IAM`, `CAPABILITY_RESOURCE_POLICY`, or `CAPABILITY_AUTO_EXPAND` * `parameters` - (Optional) A map of Parameter structures that specify input parameters for the stack. * `semantic_version` - (Optional) The version of the application to deploy. If not supplied, deploys the latest version. * `tags` - (Optional) A list of tags to associate with this stack. @@ -41,7 +48,3 @@ In addition to all arguments above, the following attributes are exported: * `id` - A unique identifier of the stack. * `outputs` - A map of outputs from the stack. - -## Import - -Import is not yet implemented. \ No newline at end of file From dc58f235bd61188b1b5a073ea29ba07740e6da5d Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 12 Nov 2020 14:26:40 -0800 Subject: [PATCH 29/42] Adds disappears test --- ...rce_aws_serverlessrepository_stack_test.go | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/aws/resource_aws_serverlessrepository_stack_test.go b/aws/resource_aws_serverlessrepository_stack_test.go index ed4b1612eed..749065f7ac3 100644 --- a/aws/resource_aws_serverlessrepository_stack_test.go +++ b/aws/resource_aws_serverlessrepository_stack_test.go @@ -44,6 +44,29 @@ func TestAccAwsServerlessRepositoryStack_basic(t *testing.T) { }) } +func TestAccAwsServerlessRepositoryStack_disappears(t *testing.T) { + var stack cloudformation.Stack + stackName := acctest.RandomWithPrefix("tf-acc-test") + + resourceName := "aws_serverlessrepository_stack.postgres-rotator" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAmiDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsServerlessRepositoryStackConfig(stackName), + Check: resource.ComposeTestCheckFunc( + testAccCheckServerlessRepositoryStackExists(resourceName, &stack), + testAccCheckResourceDisappears(testAccProvider, resourceAwsServerlessRepositoryStack(), resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + func TestAccAwsServerlessRepositoryStack_versioned(t *testing.T) { var stack cloudformation.Stack stackName := acctest.RandomWithPrefix("tf-acc-test") From 6d59d778b9452cf7418ca2708a971ef5f6f92532 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 12 Nov 2020 14:35:57 -0800 Subject: [PATCH 30/42] Create timeout constants --- .../serverlessrepository/waiter/waiter.go | 16 ++++++++++++++++ aws/resource_aws_serverlessrepository_stack.go | 7 ++++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 aws/internal/service/serverlessrepository/waiter/waiter.go diff --git a/aws/internal/service/serverlessrepository/waiter/waiter.go b/aws/internal/service/serverlessrepository/waiter/waiter.go new file mode 100644 index 00000000000..35f141d02f5 --- /dev/null +++ b/aws/internal/service/serverlessrepository/waiter/waiter.go @@ -0,0 +1,16 @@ +package waiter + +import ( + "time" +) + +const ( + // Default maximum amount of time to wait for a Stack to be Created + StackCreatedDefaultTimeout = 30 * time.Minute + + // Default maximum amount of time to wait for a Stack to be Updated + StackUpdatedDefaultTimeout = 30 * time.Minute + + // Default maximum amount of time to wait for a Stack to be Deleted + StackDeletedDefaultTimeout = 30 * time.Minute +) diff --git a/aws/resource_aws_serverlessrepository_stack.go b/aws/resource_aws_serverlessrepository_stack.go index ea96e8f1c24..288a99a68e9 100644 --- a/aws/resource_aws_serverlessrepository_stack.go +++ b/aws/resource_aws_serverlessrepository_stack.go @@ -14,6 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/serverlessrepository/waiter" ) func resourceAwsServerlessRepositoryStack() *schema.Resource { @@ -28,9 +29,9 @@ func resourceAwsServerlessRepositoryStack() *schema.Resource { }, Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(30 * time.Minute), - Update: schema.DefaultTimeout(30 * time.Minute), - Delete: schema.DefaultTimeout(30 * time.Minute), + Create: schema.DefaultTimeout(waiter.StackCreatedDefaultTimeout), + Update: schema.DefaultTimeout(waiter.StackUpdatedDefaultTimeout), + Delete: schema.DefaultTimeout(waiter.StackDeletedDefaultTimeout), }, Schema: map[string]*schema.Schema{ From 110c46f145008a8b13e28bc2352ea37dddb0773d Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 12 Nov 2020 15:16:12 -0800 Subject: [PATCH 31/42] Test stack name --- aws/resource_aws_serverlessrepository_stack.go | 1 - aws/resource_aws_serverlessrepository_stack_test.go | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_serverlessrepository_stack.go b/aws/resource_aws_serverlessrepository_stack.go index 288a99a68e9..62171c9cb14 100644 --- a/aws/resource_aws_serverlessrepository_stack.go +++ b/aws/resource_aws_serverlessrepository_stack.go @@ -254,7 +254,6 @@ func resourceAwsServerlessRepositoryStackRead(d *schema.ResourceData, meta inter // Serverless Application Repo prefixes the stack name with "serverlessrepo-", // so remove it from the saved string - // FIXME: this should be a StateFunc stackName := strings.TrimPrefix(aws.StringValue(stack.StackName), "serverlessrepo-") d.Set("name", &stackName) diff --git a/aws/resource_aws_serverlessrepository_stack_test.go b/aws/resource_aws_serverlessrepository_stack_test.go index 749065f7ac3..8af779ac6ea 100644 --- a/aws/resource_aws_serverlessrepository_stack_test.go +++ b/aws/resource_aws_serverlessrepository_stack_test.go @@ -27,6 +27,7 @@ func TestAccAwsServerlessRepositoryStack_basic(t *testing.T) { Config: testAccAwsServerlessRepositoryStackConfig(stackName), Check: resource.ComposeTestCheckFunc( testAccCheckServerlessRepositoryStackExists(resourceName, &stack), + resource.TestCheckResourceAttr(resourceName, "name", stackName), resource.TestCheckResourceAttr(resourceName, "application_id", "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), resource.TestCheckResourceAttrSet(resourceName, "semantic_version"), resource.TestCheckResourceAttr(resourceName, "parameters.%", "2"), From f84d85b6872f10aff3a3dd470ca82936336baff7 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 12 Nov 2020 16:00:02 -0800 Subject: [PATCH 32/42] Updates documentation --- .../serverlessrepository_application.html.markdown | 14 ++++++-------- .../r/serverlessrepository_stack.html.markdown | 4 ++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/website/docs/d/serverlessrepository_application.html.markdown b/website/docs/d/serverlessrepository_application.html.markdown index 4825abeb17c..ed14ea2a670 100644 --- a/website/docs/d/serverlessrepository_application.html.markdown +++ b/website/docs/d/serverlessrepository_application.html.markdown @@ -8,7 +8,7 @@ description: |- # Data Source: aws_serverlessrepository_application -Use this data source to get the source code URL and template URL of an AWS Serverless Application Repository application. +Use this data source to get information about an AWS Serverless Application Repository application. For example, this can be used to determine the required `capabilities` for an application. ## Example Usage @@ -17,12 +17,11 @@ data "aws_serverlessrepository_application" "example" { application_id = "arn:aws:serverlessrepo:us-east-1:123456789012:applications/ExampleApplication" } -resource "aws_cloudformation_stack" "example" { - name = "Example" - - capabilities = data.aws_serverlessrepository_application.example.required_capabilities - - template_url = data.aws_serverlessrepository_application.example.template_url +resource "aws_serverlessrepository_stack" "example" { + name = "Example" + application_id = data.aws_serverlessrepository_application.example.application_id + semantic_version = data.aws_serverlessrepository_application.example.semantic_version + capabilities = data.aws_serverlessrepository_application.example.required_capabilities } ``` @@ -34,7 +33,6 @@ resource "aws_cloudformation_stack" "example" { ## Attributes Reference * `application_id` - The ARN of the application. -* `semantic_version` - The version of the application retrieved. * `name` - The name of the application. * `required_capabilities` - A list of capabilities describing the permissions needed to deploy the application. * `source_code_url` - A URL pointing to the source code of the application version. diff --git a/website/docs/r/serverlessrepository_stack.html.markdown b/website/docs/r/serverlessrepository_stack.html.markdown index ea9535f2aec..b79b70fb137 100644 --- a/website/docs/r/serverlessrepository_stack.html.markdown +++ b/website/docs/r/serverlessrepository_stack.html.markdown @@ -3,7 +3,7 @@ subcategory: "Serverless Application Repository" layout: "aws" page_title: "AWS: aws_serverlessrepository_stack" description: |- - Provides a Serverless Application Repository Stack resource. + Provides a Serverless Application Repository CloudFormation Stack resource. --- # Resource: aws_serverlessrepository_application @@ -34,7 +34,7 @@ data "aws_region" "current" {} The following arguments are supported: -* `name` - (Required) The name of the stack to create. AWS prefixes this name with `serverlessrepo-` +* `name` - (Required) The name of the stack to create. The resource deployed in AWS will be prefixed with `serverlessrepo-` * `application_id` - (Required) The ARN of the application from the Serverless Application Repository. * `capabilities` - A list of capabilities. Valid values: `CAPABILITY_IAM`, `CAPABILITY_NAMED_IAM`, `CAPABILITY_RESOURCE_POLICY`, or `CAPABILITY_AUTO_EXPAND` From a7679dca7199d9a39d27cc1df945e25fa376e3e5 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 13 Nov 2020 15:49:57 -0800 Subject: [PATCH 33/42] Tweaks --- aws/resource_aws_serverlessrepository_stack_test.go | 3 +++ website/docs/r/serverlessrepository_stack.html.markdown | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_serverlessrepository_stack_test.go b/aws/resource_aws_serverlessrepository_stack_test.go index 8af779ac6ea..a528514b6fc 100644 --- a/aws/resource_aws_serverlessrepository_stack_test.go +++ b/aws/resource_aws_serverlessrepository_stack_test.go @@ -12,6 +12,9 @@ import ( "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfawsresource" ) +// Since aws_serverlessrepository_stack creates CloudFormation stacks, +// the aws_cloudformation_stack sweeper will clean these up as well. + func TestAccAwsServerlessRepositoryStack_basic(t *testing.T) { var stack cloudformation.Stack stackName := acctest.RandomWithPrefix("tf-acc-test") diff --git a/website/docs/r/serverlessrepository_stack.html.markdown b/website/docs/r/serverlessrepository_stack.html.markdown index b79b70fb137..a988eaa564c 100644 --- a/website/docs/r/serverlessrepository_stack.html.markdown +++ b/website/docs/r/serverlessrepository_stack.html.markdown @@ -3,12 +3,12 @@ subcategory: "Serverless Application Repository" layout: "aws" page_title: "AWS: aws_serverlessrepository_stack" description: |- - Provides a Serverless Application Repository CloudFormation Stack resource. + Deploys an application from the Serverless Application Repository. --- # Resource: aws_serverlessrepository_application -Provides a Serverless Application Repository CloudFormation Stack resource +Deploys an application from the Serverless Application Repository. ## Example Usage From 1ad9806a00fee193673e983405f688b7931776ed Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 20 Nov 2020 13:34:00 -0800 Subject: [PATCH 34/42] Adds exclusion to multiple AWS service rule --- .semgrep.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.semgrep.yml b/.semgrep.yml index 9660007b6aa..b8d7ee9e74e 100644 --- a/.semgrep.yml +++ b/.semgrep.yml @@ -8,6 +8,7 @@ rules: - aws/structure.go - aws/validators.go - aws/*wafregional*.go + - aws/resource_aws_serverlessrepository_stack.go - aws/*_test.go - aws/internal/keyvaluetags/ - aws/internal/service/wafregional/ From 56a5fd48b584d650a72ade77867fd5de1c17dcb5 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 23 Nov 2020 17:43:40 -0800 Subject: [PATCH 35/42] Adds import functionality --- ...ce_aws_serverlessrepository_application.go | 23 ++- ...s_serverlessrepository_application_test.go | 4 +- .../service/cloudformation/finder/finder.go | 56 ++++++++ .../service/cloudformation/waiter/status.go | 6 + .../serverlessrepository/finder/finder.go | 43 ++++++ ...resource_aws_serverlessrepository_stack.go | 134 +++++++++++++----- ...rce_aws_serverlessrepository_stack_test.go | 49 +++++++ .../serverlessrepository_stack.html.markdown | 16 ++- 8 files changed, 272 insertions(+), 59 deletions(-) create mode 100644 aws/internal/service/cloudformation/finder/finder.go create mode 100644 aws/internal/service/serverlessrepository/finder/finder.go diff --git a/aws/data_source_aws_serverlessrepository_application.go b/aws/data_source_aws_serverlessrepository_application.go index 23767522252..b291d531e31 100644 --- a/aws/data_source_aws_serverlessrepository_application.go +++ b/aws/data_source_aws_serverlessrepository_application.go @@ -2,11 +2,9 @@ package aws import ( "fmt" - "log" - "github.com/aws/aws-sdk-go/aws" - serverlessrepository "github.com/aws/aws-sdk-go/service/serverlessapplicationrepository" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/serverlessrepository/finder" ) func dataSourceAwsServerlessRepositoryApplication() *schema.Resource { @@ -50,20 +48,15 @@ func dataSourceAwsServerlessRepositoryApplicationRead(d *schema.ResourceData, me conn := meta.(*AWSClient).serverlessapplicationrepositoryconn applicationID := d.Get("application_id").(string) + semanticVersion := d.Get("semantic_version").(string) - input := &serverlessrepository.GetApplicationInput{ - ApplicationId: aws.String(applicationID), - } - - if v, ok := d.GetOk("semantic_version"); ok { - version := v.(string) - input.SemanticVersion = aws.String(version) - } - log.Printf("[DEBUG] Reading Serverless Application Repository application with request: %s", input) - - output, err := conn.GetApplication(input) + output, err := finder.Application(conn, applicationID, semanticVersion) if err != nil { - return fmt.Errorf("error reading Serverless Application Repository application (%s): %w", applicationID, err) + descriptor := applicationID + if semanticVersion != "" { + descriptor += fmt.Sprintf(", version %s", semanticVersion) + } + return fmt.Errorf("error getting Serverless Application Repository application (%s): %w", descriptor, err) } d.SetId(applicationID) diff --git a/aws/data_source_aws_serverlessrepository_application_test.go b/aws/data_source_aws_serverlessrepository_application_test.go index 593f4f4aa20..c28a5567472 100644 --- a/aws/data_source_aws_serverlessrepository_application_test.go +++ b/aws/data_source_aws_serverlessrepository_application_test.go @@ -30,7 +30,7 @@ func TestAccDataSourceAwsServerlessRepositoryApplication_Basic(t *testing.T) { }, { Config: testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_NonExistent, - ExpectError: regexp.MustCompile(`error reading Serverless Application Repository application`), + ExpectError: regexp.MustCompile(`error getting Serverless Application Repository application`), }, }, }) @@ -73,7 +73,7 @@ func TestAccDataSourceAwsServerlessRepositoryApplication_Versioned(t *testing.T) }, { Config: testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_Versioned_NonExistent, - ExpectError: regexp.MustCompile(`error reading Serverless Application Repository application`), + ExpectError: regexp.MustCompile(`error getting Serverless Application Repository application`), }, }, }) diff --git a/aws/internal/service/cloudformation/finder/finder.go b/aws/internal/service/cloudformation/finder/finder.go new file mode 100644 index 00000000000..88f58fed5ba --- /dev/null +++ b/aws/internal/service/cloudformation/finder/finder.go @@ -0,0 +1,56 @@ +package finder + +import ( + "log" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/cloudformation" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func Stack(conn *cloudformation.CloudFormation, stackID string) (*cloudformation.Stack, error) { + input := &cloudformation.DescribeStacksInput{ + StackName: aws.String(stackID), + } + log.Printf("[DEBUG] Querying CloudFormation Stack: %s", input) + resp, err := conn.DescribeStacks(input) + if tfawserr.ErrCodeEquals(err, "ValidationError") { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: input, + LastResponse: resp, + } + } + if err != nil { + return nil, err + } + + if resp == nil { + return nil, &resource.NotFoundError{ + LastRequest: input, + LastResponse: resp, + Message: "returned empty response", + } + + } + stacks := resp.Stacks + if len(stacks) < 1 { + return nil, &resource.NotFoundError{ + LastRequest: input, + LastResponse: resp, + Message: "returned no results", + } + } + + stack := stacks[0] + if aws.StringValue(stack.StackStatus) == cloudformation.StackStatusDeleteComplete { + return nil, &resource.NotFoundError{ + LastRequest: input, + LastResponse: resp, + Message: "CloudFormation Stack deleted", + } + } + + return stack, nil +} diff --git a/aws/internal/service/cloudformation/waiter/status.go b/aws/internal/service/cloudformation/waiter/status.go index 36945fc1176..cdfa0fd0769 100644 --- a/aws/internal/service/cloudformation/waiter/status.go +++ b/aws/internal/service/cloudformation/waiter/status.go @@ -21,6 +21,12 @@ func ChangeSetStatus(conn *cloudformation.CloudFormation, stackID, changeSetName log.Printf("[ERROR] Failed to describe CloudFormation change set: %s", err) return nil, "", err } + + if resp == nil { + log.Printf("[WARN] Describing CloudFormation change set returned no response") + return nil, "", nil + } + status := aws.StringValue(resp.Status) return resp, status, err diff --git a/aws/internal/service/serverlessrepository/finder/finder.go b/aws/internal/service/serverlessrepository/finder/finder.go new file mode 100644 index 00000000000..e99f9db910b --- /dev/null +++ b/aws/internal/service/serverlessrepository/finder/finder.go @@ -0,0 +1,43 @@ +package finder + +import ( + "log" + + "github.com/aws/aws-sdk-go/aws" + serverlessrepository "github.com/aws/aws-sdk-go/service/serverlessapplicationrepository" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func Application(conn *serverlessrepository.ServerlessApplicationRepository, applicationID, version string) (*serverlessrepository.GetApplicationOutput, error) { + input := &serverlessrepository.GetApplicationInput{ + ApplicationId: aws.String(applicationID), + } + if version != "" { + input.SemanticVersion = aws.String(version) + } + + log.Printf("[DEBUG] Getting Serverless Application Repository Application: %s", input) + resp, err := conn.GetApplication(input) + if tfawserr.ErrCodeEquals(err, serverlessrepository.ErrCodeNotFoundException) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: input, + LastResponse: resp, + } + } + if err != nil { + return nil, err + } + + if resp == nil { + return nil, &resource.NotFoundError{ + LastRequest: input, + LastResponse: resp, + Message: "returned empty response", + } + } + + return resp, nil + +} diff --git a/aws/resource_aws_serverlessrepository_stack.go b/aws/resource_aws_serverlessrepository_stack.go index a40e7e4aa51..465a7f2c5b8 100644 --- a/aws/resource_aws_serverlessrepository_stack.go +++ b/aws/resource_aws_serverlessrepository_stack.go @@ -1,11 +1,13 @@ package aws import ( + "errors" "fmt" "log" "strings" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/cloudformation" serverlessrepository "github.com/aws/aws-sdk-go/service/serverlessapplicationrepository" "github.com/hashicorp/aws-sdk-go-base/tfawserr" @@ -13,10 +15,14 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + cffinder "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/finder" cfwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/waiter" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/serverlessrepository/finder" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/serverlessrepository/waiter" ) +const serverlessRepositoryStackNamePrefix = "serverlessrepo-" + func resourceAwsServerlessRepositoryStack() *schema.Resource { return &schema.Resource{ Create: resourceAwsServerlessRepositoryStackCreate, @@ -25,7 +31,7 @@ func resourceAwsServerlessRepositoryStack() *schema.Resource { Delete: resourceAwsServerlessRepositoryStackDelete, Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, + State: resourceAwsServerlessRepositoryStackImport, }, Timeouts: &schema.ResourceTimeout{ @@ -138,53 +144,44 @@ func resourceAwsServerlessRepositoryStackRead(d *schema.ResourceData, meta inter cfConn := meta.(*AWSClient).cfconn ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig - getApplicationInput := &serverlessrepository.GetApplicationInput{ - ApplicationId: aws.String(d.Get("application_id").(string)), - } - - _, ok := d.GetOk("semantic_version") - if !ok { - getApplicationOutput, err := serverlessConn.GetApplication(getApplicationInput) - if err != nil { - return err - } - d.Set("semantic_version", getApplicationOutput.Version.SemanticVersion) + applicationID := d.Get("application_id").(string) + semanticVersion := d.Get("semantic_version").(string) + descriptor := applicationID + if semanticVersion != "" { + descriptor += fmt.Sprintf(", version %s", semanticVersion) } - input := &cloudformation.DescribeStacksInput{ - StackName: aws.String(d.Id()), - } - resp, err := cfConn.DescribeStacks(input) - if tfawserr.ErrCodeEquals(err, "ValidationError") { - log.Printf("[WARN] CloudFormation stack (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } + getApplicationOutput, err := finder.Application(serverlessConn, applicationID, semanticVersion) if err != nil { - return err + return fmt.Errorf("error getting Serverless Application Repository application (%s): %w", descriptor, err) } - stacks := resp.Stacks - if len(stacks) < 1 { - log.Printf("[WARN] CloudFormation stack (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil + if getApplicationOutput.Version == nil { + return fmt.Errorf("error getting Serverless Application Repository application (%s): returned empty version record", descriptor) } - stack := stacks[0] - if aws.StringValue(stack.StackStatus) == cloudformation.StackStatusDeleteComplete { + version := getApplicationOutput.Version + d.Set("semantic_version", version.SemanticVersion) + + parameterDefinitions := flattenServerlessRepositoryParameterDefinitions(version.ParameterDefinitions) + + stack, err := cffinder.Stack(cfConn, d.Id()) + var e *resource.NotFoundError + if errors.As(err, &e) { log.Printf("[WARN] CloudFormation stack (%s) not found, removing from state", d.Id()) d.SetId("") return nil } + if err != nil { + return fmt.Errorf("error describing CloudFormation Stack (%s): %w", d.Id(), err) + } // Serverless Application Repo prefixes the stack name with "serverlessrepo-", // so remove it from the saved string - stackName := strings.TrimPrefix(aws.StringValue(stack.StackName), "serverlessrepo-") + stackName := strings.TrimPrefix(aws.StringValue(stack.StackName), serverlessRepositoryStackNamePrefix) d.Set("name", &stackName) - originalParams := d.Get("parameters").(map[string]interface{}) - if err = d.Set("parameters", flattenCloudFormationParameters(stack.Parameters, originalParams)); err != nil { + if err = d.Set("parameters", flattenSomeCloudFormationParameters(stack.Parameters, parameterDefinitions)); err != nil { return fmt.Errorf("failed to set parameters: %w", err) } @@ -196,13 +193,33 @@ func resourceAwsServerlessRepositoryStackRead(d *schema.ResourceData, meta inter return fmt.Errorf("failed to set outputs: %w", err) } - if err = d.Set("capabilities", flattenServerlessRepositoryStackCapabilities(d, stack.Capabilities)); err != nil { + if err = d.Set("capabilities", flattenServerlessRepositoryStackCapabilities(stack.Capabilities, version.RequiredCapabilities)); err != nil { return fmt.Errorf("failed to set capabilities: %w", err) } return nil } +func flattenSomeCloudFormationParameters(cfParams []*cloudformation.Parameter, parameterDefinitions map[string]*serverlessrepository.ParameterDefinition) map[string]interface{} { + params := make(map[string]interface{}, len(cfParams)) + for _, p := range cfParams { + key := aws.StringValue(p.ParameterKey) + value := aws.StringValue(p.ParameterValue) + if value != aws.StringValue(parameterDefinitions[key].DefaultValue) { + params[key] = value + } + } + return params +} + +func flattenServerlessRepositoryParameterDefinitions(parameterDefinitions []*serverlessrepository.ParameterDefinition) map[string]*serverlessrepository.ParameterDefinition { + result := make(map[string]*serverlessrepository.ParameterDefinition, len(parameterDefinitions)) + for _, p := range parameterDefinitions { + result[aws.StringValue(p.Name)] = p + } + return result +} + func resourceAwsServerlessRepositoryStackUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).cfconn @@ -286,6 +303,45 @@ func resourceAwsServerlessRepositoryStackDelete(d *schema.ResourceData, meta int return nil } +func resourceAwsServerlessRepositoryStackImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + stackID := d.Id() + + // If this isn't an ARN, it's the stack name + if _, err := arn.Parse(stackID); err != nil { + if !strings.HasPrefix(stackID, serverlessRepositoryStackNamePrefix) { + stackID = serverlessRepositoryStackNamePrefix + stackID + } + } + + cfConn := meta.(*AWSClient).cfconn + stack, err := cffinder.Stack(cfConn, stackID) + if err != nil { + return nil, fmt.Errorf("error describing Serverless Application Repository CloudFormation Stack (%s): %w", stackID, err) + } + + tags := stack.Tags + var applicationID, semanticVersion string + for _, tag := range tags { + if aws.StringValue(tag.Key) == "serverlessrepo:applicationId" { + applicationID = aws.StringValue(tag.Value) + } else if aws.StringValue(tag.Key) == "serverlessrepo:semanticVersion" { + semanticVersion = aws.StringValue(tag.Value) + } + if applicationID != "" && semanticVersion != "" { + break + } + } + if applicationID == "" || semanticVersion == "" { + return nil, fmt.Errorf("cannot import Serverless Application Repository CloudFormation Stack (%s): tags \"serverlessrepo:applicationId\" and \"serverlessrepo:semanticVersion\" must be defined", stackID) + } + + d.SetId(aws.StringValue(stack.StackId)) + d.Set("application_id", applicationID) + d.Set("semantic_version", semanticVersion) + + return []*schema.ResourceData{d}, nil +} + func expandServerlessRepositoryChangeSetParameters(params map[string]interface{}) []*serverlessrepository.ParameterValue { var appParams []*serverlessrepository.ParameterValue for k, v := range params { @@ -297,13 +353,15 @@ func expandServerlessRepositoryChangeSetParameters(params map[string]interface{} return appParams } -func flattenServerlessRepositoryStackCapabilities(d *schema.ResourceData, c []*string) *schema.Set { +func flattenServerlessRepositoryStackCapabilities(stackCapabilities []*string, applicationRequiredCapabilities []*string) *schema.Set { // We need to preserve "CAPABILITY_RESOURCE_POLICY" if it has been set. It is not // returned by the CloudFormation APIs. - existingCapabilities := d.Get("capabilities").(*schema.Set) - capabilities := flattenStringSet(c) - if existingCapabilities.Contains(serverlessrepository.CapabilityCapabilityResourcePolicy) { - capabilities.Add(serverlessrepository.CapabilityCapabilityResourcePolicy) + capabilities := flattenStringSet(stackCapabilities) + for _, capability := range applicationRequiredCapabilities { + if aws.StringValue(capability) == serverlessrepository.CapabilityCapabilityResourcePolicy { + capabilities.Add(serverlessrepository.CapabilityCapabilityResourcePolicy) + break + } } return capabilities } diff --git a/aws/resource_aws_serverlessrepository_stack_test.go b/aws/resource_aws_serverlessrepository_stack_test.go index a7c14543813..46e6308f44c 100644 --- a/aws/resource_aws_serverlessrepository_stack_test.go +++ b/aws/resource_aws_serverlessrepository_stack_test.go @@ -44,6 +44,23 @@ func TestAccAwsServerlessRepositoryStack_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + ResourceName: resourceName, + ImportStateIdFunc: testAccAwsServerlessRepositoryStackNameImportStateIdFunc(resourceName), + ImportState: true, + ImportStateVerify: true, + }, + { + ResourceName: resourceName, + ImportStateIdFunc: testAccAwsServerlessRepositoryStackNameNoPrefixImportStateIdFunc(resourceName), + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -96,6 +113,11 @@ func TestAccAwsServerlessRepositoryStack_versioned(t *testing.T) { tfawsresource.TestCheckTypeSetElemAttr(resourceName, "capabilities.*", "CAPABILITY_IAM"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSServerlessRepositoryStackConfig_versioned2(stackName, version2), Check: resource.ComposeTestCheckFunc( @@ -166,6 +188,11 @@ func TestAccAwsServerlessRepositoryStack_Tags(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAwsServerlessRepositoryStackConfigTags2(stackName, "key1", "value1updated", "key2", "value2"), Check: resource.ComposeTestCheckFunc( @@ -247,6 +274,28 @@ func testAccCheckServerlessRepositoryStackExists(n string, stack *cloudformation } } +func testAccAwsServerlessRepositoryStackNameImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { + return func(s *terraform.State) (string, error) { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return "", fmt.Errorf("Not found: %s", resourceName) + } + + return fmt.Sprintf("%s%s", serverlessRepositoryStackNamePrefix, rs.Primary.Attributes["name"]), nil + } +} + +func testAccAwsServerlessRepositoryStackNameNoPrefixImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { + return func(s *terraform.State) (string, error) { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return "", fmt.Errorf("Not found: %s", resourceName) + } + + return rs.Primary.Attributes["name"], nil + } +} + func testAccAwsServerlessRepositoryStackConfig(stackName string) string { return composeConfig( testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication, diff --git a/website/docs/r/serverlessrepository_stack.html.markdown b/website/docs/r/serverlessrepository_stack.html.markdown index a988eaa564c..363dea5d343 100644 --- a/website/docs/r/serverlessrepository_stack.html.markdown +++ b/website/docs/r/serverlessrepository_stack.html.markdown @@ -3,17 +3,17 @@ subcategory: "Serverless Application Repository" layout: "aws" page_title: "AWS: aws_serverlessrepository_stack" description: |- - Deploys an application from the Serverless Application Repository. + Deploys an Application CloudFormation Stack from the Serverless Application Repository. --- -# Resource: aws_serverlessrepository_application +# Resource: aws_serverlessrepository_stack -Deploys an application from the Serverless Application Repository. +Deploys an Application CloudFormation Stack from the Serverless Application Repository. ## Example Usage ```hcl -resource "aws_serverlessrepository_application" "postgres-rotator" { +resource "aws_serverlessrepository_stack" "postgres-rotator" { name = "postgres-rotator" application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" capabilities = [ @@ -48,3 +48,11 @@ In addition to all arguments above, the following attributes are exported: * `id` - A unique identifier of the stack. * `outputs` - A map of outputs from the stack. + +## Import + +Serverless Application Repository Stack can be imported using the CloudFormation Stack name (with or without the `serverlessrepo-` prefix) or the CloudFormation Stack ID, e.g. + +``` +$ terraform import aws_serverlessrepository_stack.example serverlessrepo-postgres-rotator +``` From f3aabe173add463f96936f8c36f5eb8326a9923f Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 23 Nov 2020 23:32:18 -0800 Subject: [PATCH 36/42] Renaming to match package name --- .semgrep.yml | 2 +- ...rlessapplicationrepository_application.go} | 4 +- ...applicationrepository_application_test.go} | 12 +- .../finder/finder.go | 0 .../waiter/waiter.go | 6 +- aws/provider.go | 1676 ++++++++--------- ...icationrepository_cloudformation_stack.go} | 52 +- ...onrepository_cloudformation_stack_test.go} | 42 +- docs/roadmaps/2020_August_to_October.md | 4 +- ...ationrepository_application.html.markdown} | 14 +- ...applicationrepository_stack.html.markdown} | 8 +- 11 files changed, 910 insertions(+), 910 deletions(-) rename aws/{data_source_aws_serverlessrepository_application.go => data_source_aws_serverlessapplicationrepository_application.go} (93%) rename aws/{data_source_aws_serverlessrepository_application_test.go => data_source_aws_serverlessapplicationrepository_application_test.go} (88%) rename aws/internal/service/{serverlessrepository => serverlessapplicationrepository}/finder/finder.go (100%) rename aws/internal/service/{serverlessrepository => serverlessapplicationrepository}/waiter/waiter.go (58%) rename aws/{resource_aws_serverlessrepository_stack.go => resource_aws_serverlessapplicationrepository_cloudformation_stack.go} (83%) rename aws/{resource_aws_serverlessrepository_stack_test.go => resource_aws_serverlessapplicationrepository_cloudformation_stack_test.go} (88%) rename website/docs/d/{serverlessrepository_application.html.markdown => serverlessapplicationrepository_application.html.markdown} (66%) rename website/docs/r/{serverlessrepository_stack.html.markdown => serverlessapplicationrepository_stack.html.markdown} (84%) diff --git a/.semgrep.yml b/.semgrep.yml index b8d7ee9e74e..3520fd50fad 100644 --- a/.semgrep.yml +++ b/.semgrep.yml @@ -8,7 +8,7 @@ rules: - aws/structure.go - aws/validators.go - aws/*wafregional*.go - - aws/resource_aws_serverlessrepository_stack.go + - aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go - aws/*_test.go - aws/internal/keyvaluetags/ - aws/internal/service/wafregional/ diff --git a/aws/data_source_aws_serverlessrepository_application.go b/aws/data_source_aws_serverlessapplicationrepository_application.go similarity index 93% rename from aws/data_source_aws_serverlessrepository_application.go rename to aws/data_source_aws_serverlessapplicationrepository_application.go index b291d531e31..f1e3980a50b 100644 --- a/aws/data_source_aws_serverlessrepository_application.go +++ b/aws/data_source_aws_serverlessapplicationrepository_application.go @@ -4,10 +4,10 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/serverlessrepository/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/serverlessapplicationrepository/finder" ) -func dataSourceAwsServerlessRepositoryApplication() *schema.Resource { +func dataSourceAwsServerlessApplicationRepositoryApplication() *schema.Resource { return &schema.Resource{ Read: dataSourceAwsServerlessRepositoryApplicationRead, diff --git a/aws/data_source_aws_serverlessrepository_application_test.go b/aws/data_source_aws_serverlessapplicationrepository_application_test.go similarity index 88% rename from aws/data_source_aws_serverlessrepository_application_test.go rename to aws/data_source_aws_serverlessapplicationrepository_application_test.go index c28a5567472..ee5dfb2d1a7 100644 --- a/aws/data_source_aws_serverlessrepository_application_test.go +++ b/aws/data_source_aws_serverlessapplicationrepository_application_test.go @@ -11,7 +11,7 @@ import ( ) func TestAccDataSourceAwsServerlessRepositoryApplication_Basic(t *testing.T) { - datasourceName := "data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator" + datasourceName := "data.aws_serverlessapplicationrepository_application.secrets_manager_postgres_single_user_rotator" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -36,7 +36,7 @@ func TestAccDataSourceAwsServerlessRepositoryApplication_Basic(t *testing.T) { }) } func TestAccDataSourceAwsServerlessRepositoryApplication_Versioned(t *testing.T) { - datasourceName := "data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator" + datasourceName := "data.aws_serverlessapplicationrepository_application.secrets_manager_postgres_single_user_rotator" const ( version1 = "1.0.13" @@ -94,13 +94,13 @@ func testAccCheckAwsServerlessRepositoryApplicationDataSourceID(n string) resour } const testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig = testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication + ` -data "aws_serverlessrepository_application" "secrets_manager_postgres_single_user_rotator" { +data "aws_serverlessapplicationrepository_application" "secrets_manager_postgres_single_user_rotator" { application_id = local.postgres_single_user_rotator_arn } ` const testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_NonExistent = ` -data "aws_serverlessrepository_application" "no_such_function" { +data "aws_serverlessapplicationrepository_application" "no_such_function" { application_id = "arn:${data.aws_partition.current.partition}:serverlessrepo:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:applications/ThisFunctionDoesNotExist" } @@ -113,7 +113,7 @@ func testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_Versioned(ve return composeConfig( testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication, fmt.Sprintf(` -data "aws_serverlessrepository_application" "secrets_manager_postgres_single_user_rotator" { +data "aws_serverlessapplicationrepository_application" "secrets_manager_postgres_single_user_rotator" { application_id = local.postgres_single_user_rotator_arn semantic_version = "%[1]s" } @@ -121,7 +121,7 @@ data "aws_serverlessrepository_application" "secrets_manager_postgres_single_use } const testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_Versioned_NonExistent = testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication + ` -data "aws_serverlessrepository_application" "secrets_manager_postgres_single_user_rotator" { +data "aws_serverlessapplicationrepository_application" "secrets_manager_postgres_single_user_rotator" { application_id = local.postgres_single_user_rotator_arn semantic_version = "42.13.7" } diff --git a/aws/internal/service/serverlessrepository/finder/finder.go b/aws/internal/service/serverlessapplicationrepository/finder/finder.go similarity index 100% rename from aws/internal/service/serverlessrepository/finder/finder.go rename to aws/internal/service/serverlessapplicationrepository/finder/finder.go diff --git a/aws/internal/service/serverlessrepository/waiter/waiter.go b/aws/internal/service/serverlessapplicationrepository/waiter/waiter.go similarity index 58% rename from aws/internal/service/serverlessrepository/waiter/waiter.go rename to aws/internal/service/serverlessapplicationrepository/waiter/waiter.go index 35f141d02f5..f6a82e79792 100644 --- a/aws/internal/service/serverlessrepository/waiter/waiter.go +++ b/aws/internal/service/serverlessapplicationrepository/waiter/waiter.go @@ -6,11 +6,11 @@ import ( const ( // Default maximum amount of time to wait for a Stack to be Created - StackCreatedDefaultTimeout = 30 * time.Minute + CloudFormationStackCreatedDefaultTimeout = 30 * time.Minute // Default maximum amount of time to wait for a Stack to be Updated - StackUpdatedDefaultTimeout = 30 * time.Minute + CloudFormationStackUpdatedDefaultTimeout = 30 * time.Minute // Default maximum amount of time to wait for a Stack to be Deleted - StackDeletedDefaultTimeout = 30 * time.Minute + CloudFormationStackDeletedDefaultTimeout = 30 * time.Minute ) diff --git a/aws/provider.go b/aws/provider.go index 74d20e9f15b..96bfd942fbd 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -165,218 +165,218 @@ func Provider() *schema.Provider { }, DataSourcesMap: map[string]*schema.Resource{ - "aws_acm_certificate": dataSourceAwsAcmCertificate(), - "aws_acmpca_certificate_authority": dataSourceAwsAcmpcaCertificateAuthority(), - "aws_ami": dataSourceAwsAmi(), - "aws_ami_ids": dataSourceAwsAmiIds(), - "aws_api_gateway_api_key": dataSourceAwsApiGatewayApiKey(), - "aws_api_gateway_resource": dataSourceAwsApiGatewayResource(), - "aws_api_gateway_rest_api": dataSourceAwsApiGatewayRestApi(), - "aws_api_gateway_vpc_link": dataSourceAwsApiGatewayVpcLink(), - "aws_arn": dataSourceAwsArn(), - "aws_autoscaling_group": dataSourceAwsAutoscalingGroup(), - "aws_autoscaling_groups": dataSourceAwsAutoscalingGroups(), - "aws_availability_zone": dataSourceAwsAvailabilityZone(), - "aws_availability_zones": dataSourceAwsAvailabilityZones(), - "aws_backup_plan": dataSourceAwsBackupPlan(), - "aws_backup_selection": dataSourceAwsBackupSelection(), - "aws_backup_vault": dataSourceAwsBackupVault(), - "aws_batch_compute_environment": dataSourceAwsBatchComputeEnvironment(), - "aws_batch_job_queue": dataSourceAwsBatchJobQueue(), - "aws_billing_service_account": dataSourceAwsBillingServiceAccount(), - "aws_caller_identity": dataSourceAwsCallerIdentity(), - "aws_canonical_user_id": dataSourceAwsCanonicalUserId(), - "aws_cloudformation_export": dataSourceAwsCloudFormationExport(), - "aws_cloudformation_stack": dataSourceAwsCloudFormationStack(), - "aws_cloudfront_distribution": dataSourceAwsCloudFrontDistribution(), - "aws_cloudhsm_v2_cluster": dataSourceCloudHsmV2Cluster(), - "aws_cloudtrail_service_account": dataSourceAwsCloudTrailServiceAccount(), - "aws_cloudwatch_log_group": dataSourceAwsCloudwatchLogGroup(), - "aws_codeartifact_authorization_token": dataSourceAwsCodeArtifactAuthorizationToken(), - "aws_codeartifact_repository_endpoint": dataSourceAwsCodeArtifactRepositoryEndpoint(), - "aws_cognito_user_pools": dataSourceAwsCognitoUserPools(), - "aws_codecommit_repository": dataSourceAwsCodeCommitRepository(), - "aws_cur_report_definition": dataSourceAwsCurReportDefinition(), - "aws_db_cluster_snapshot": dataSourceAwsDbClusterSnapshot(), - "aws_db_event_categories": dataSourceAwsDbEventCategories(), - "aws_db_instance": dataSourceAwsDbInstance(), - "aws_db_snapshot": dataSourceAwsDbSnapshot(), - "aws_db_subnet_group": dataSourceAwsDbSubnetGroup(), - "aws_directory_service_directory": dataSourceAwsDirectoryServiceDirectory(), - "aws_docdb_engine_version": dataSourceAwsDocdbEngineVersion(), - "aws_docdb_orderable_db_instance": dataSourceAwsDocdbOrderableDbInstance(), - "aws_dx_gateway": dataSourceAwsDxGateway(), - "aws_dynamodb_table": dataSourceAwsDynamoDbTable(), - "aws_ebs_default_kms_key": dataSourceAwsEbsDefaultKmsKey(), - "aws_ebs_encryption_by_default": dataSourceAwsEbsEncryptionByDefault(), - "aws_ebs_snapshot": dataSourceAwsEbsSnapshot(), - "aws_ebs_snapshot_ids": dataSourceAwsEbsSnapshotIds(), - "aws_ebs_volume": dataSourceAwsEbsVolume(), - "aws_ebs_volumes": dataSourceAwsEbsVolumes(), - "aws_ec2_coip_pool": dataSourceAwsEc2CoipPool(), - "aws_ec2_coip_pools": dataSourceAwsEc2CoipPools(), - "aws_ec2_instance_type": dataSourceAwsEc2InstanceType(), - "aws_ec2_instance_type_offering": dataSourceAwsEc2InstanceTypeOffering(), - "aws_ec2_instance_type_offerings": dataSourceAwsEc2InstanceTypeOfferings(), - "aws_ec2_local_gateway": dataSourceAwsEc2LocalGateway(), - "aws_ec2_local_gateways": dataSourceAwsEc2LocalGateways(), - "aws_ec2_local_gateway_route_table": dataSourceAwsEc2LocalGatewayRouteTable(), - "aws_ec2_local_gateway_route_tables": dataSourceAwsEc2LocalGatewayRouteTables(), - "aws_ec2_local_gateway_virtual_interface": dataSourceAwsEc2LocalGatewayVirtualInterface(), - "aws_ec2_local_gateway_virtual_interface_group": dataSourceAwsEc2LocalGatewayVirtualInterfaceGroup(), - "aws_ec2_local_gateway_virtual_interface_groups": dataSourceAwsEc2LocalGatewayVirtualInterfaceGroups(), - "aws_ec2_spot_price": dataSourceAwsEc2SpotPrice(), - "aws_ec2_transit_gateway": dataSourceAwsEc2TransitGateway(), - "aws_ec2_transit_gateway_dx_gateway_attachment": dataSourceAwsEc2TransitGatewayDxGatewayAttachment(), - "aws_ec2_transit_gateway_peering_attachment": dataSourceAwsEc2TransitGatewayPeeringAttachment(), - "aws_ec2_transit_gateway_route_table": dataSourceAwsEc2TransitGatewayRouteTable(), - "aws_ec2_transit_gateway_vpc_attachment": dataSourceAwsEc2TransitGatewayVpcAttachment(), - "aws_ec2_transit_gateway_vpn_attachment": dataSourceAwsEc2TransitGatewayVpnAttachment(), - "aws_ecr_authorization_token": dataSourceAwsEcrAuthorizationToken(), - "aws_ecr_image": dataSourceAwsEcrImage(), - "aws_ecr_repository": dataSourceAwsEcrRepository(), - "aws_ecs_cluster": dataSourceAwsEcsCluster(), - "aws_ecs_container_definition": dataSourceAwsEcsContainerDefinition(), - "aws_ecs_service": dataSourceAwsEcsService(), - "aws_ecs_task_definition": dataSourceAwsEcsTaskDefinition(), - "aws_customer_gateway": dataSourceAwsCustomerGateway(), - "aws_efs_access_point": dataSourceAwsEfsAccessPoint(), - "aws_efs_access_points": dataSourceAwsEfsAccessPoints(), - "aws_efs_file_system": dataSourceAwsEfsFileSystem(), - "aws_efs_mount_target": dataSourceAwsEfsMountTarget(), - "aws_eip": dataSourceAwsEip(), - "aws_eks_cluster": dataSourceAwsEksCluster(), - "aws_eks_cluster_auth": dataSourceAwsEksClusterAuth(), - "aws_elastic_beanstalk_application": dataSourceAwsElasticBeanstalkApplication(), - "aws_elastic_beanstalk_hosted_zone": dataSourceAwsElasticBeanstalkHostedZone(), - "aws_elastic_beanstalk_solution_stack": dataSourceAwsElasticBeanstalkSolutionStack(), - "aws_elasticache_cluster": dataSourceAwsElastiCacheCluster(), - "aws_elasticsearch_domain": dataSourceAwsElasticSearchDomain(), - "aws_elb": dataSourceAwsElb(), - "aws_elasticache_replication_group": dataSourceAwsElasticacheReplicationGroup(), - "aws_elb_hosted_zone_id": dataSourceAwsElbHostedZoneId(), - "aws_elb_service_account": dataSourceAwsElbServiceAccount(), - "aws_glue_script": dataSourceAwsGlueScript(), - "aws_guardduty_detector": dataSourceAwsGuarddutyDetector(), - "aws_iam_account_alias": dataSourceAwsIamAccountAlias(), - "aws_iam_group": dataSourceAwsIAMGroup(), - "aws_iam_instance_profile": dataSourceAwsIAMInstanceProfile(), - "aws_iam_policy": dataSourceAwsIAMPolicy(), - "aws_iam_policy_document": dataSourceAwsIamPolicyDocument(), - "aws_iam_role": dataSourceAwsIAMRole(), - "aws_iam_server_certificate": dataSourceAwsIAMServerCertificate(), - "aws_iam_user": dataSourceAwsIAMUser(), - "aws_imagebuilder_component": dataSourceAwsImageBuilderComponent(), - "aws_imagebuilder_distribution_configuration": datasourceAwsImageBuilderDistributionConfiguration(), - "aws_imagebuilder_infrastructure_configuration": datasourceAwsImageBuilderInfrastructureConfiguration(), - "aws_internet_gateway": dataSourceAwsInternetGateway(), - "aws_iot_endpoint": dataSourceAwsIotEndpoint(), - "aws_inspector_rules_packages": dataSourceAwsInspectorRulesPackages(), - "aws_instance": dataSourceAwsInstance(), - "aws_instances": dataSourceAwsInstances(), - "aws_ip_ranges": dataSourceAwsIPRanges(), - "aws_kinesis_stream": dataSourceAwsKinesisStream(), - "aws_kms_alias": dataSourceAwsKmsAlias(), - "aws_kms_ciphertext": dataSourceAwsKmsCiphertext(), - "aws_kms_key": dataSourceAwsKmsKey(), - "aws_kms_secret": dataSourceAwsKmsSecret(), - "aws_kms_secrets": dataSourceAwsKmsSecrets(), - "aws_lambda_alias": dataSourceAwsLambdaAlias(), - "aws_lambda_function": dataSourceAwsLambdaFunction(), - "aws_lambda_invocation": dataSourceAwsLambdaInvocation(), - "aws_lambda_layer_version": dataSourceAwsLambdaLayerVersion(), - "aws_launch_configuration": dataSourceAwsLaunchConfiguration(), - "aws_launch_template": dataSourceAwsLaunchTemplate(), - "aws_lex_bot": dataSourceAwsLexBot(), - "aws_lex_bot_alias": dataSourceAwsLexBotAlias(), - "aws_lex_intent": dataSourceAwsLexIntent(), - "aws_lex_slot_type": dataSourceAwsLexSlotType(), - "aws_mq_broker": dataSourceAwsMqBroker(), - "aws_msk_cluster": dataSourceAwsMskCluster(), - "aws_msk_configuration": dataSourceAwsMskConfiguration(), - "aws_nat_gateway": dataSourceAwsNatGateway(), - "aws_neptune_orderable_db_instance": dataSourceAwsNeptuneOrderableDbInstance(), - "aws_neptune_engine_version": dataSourceAwsNeptuneEngineVersion(), - "aws_network_acls": dataSourceAwsNetworkAcls(), - "aws_network_interface": dataSourceAwsNetworkInterface(), - "aws_network_interfaces": dataSourceAwsNetworkInterfaces(), - "aws_organizations_organization": dataSourceAwsOrganizationsOrganization(), - "aws_organizations_organizational_units": dataSourceAwsOrganizationsOrganizationalUnits(), - "aws_outposts_outpost": dataSourceAwsOutpostsOutpost(), - "aws_outposts_outpost_instance_type": dataSourceAwsOutpostsOutpostInstanceType(), - "aws_outposts_outpost_instance_types": dataSourceAwsOutpostsOutpostInstanceTypes(), - "aws_outposts_outposts": dataSourceAwsOutpostsOutposts(), - "aws_outposts_site": dataSourceAwsOutpostsSite(), - "aws_outposts_sites": dataSourceAwsOutpostsSites(), - "aws_partition": dataSourceAwsPartition(), - "aws_prefix_list": dataSourceAwsPrefixList(), - "aws_pricing_product": dataSourceAwsPricingProduct(), - "aws_qldb_ledger": dataSourceAwsQLDBLedger(), - "aws_ram_resource_share": dataSourceAwsRamResourceShare(), - "aws_rds_certificate": dataSourceAwsRdsCertificate(), - "aws_rds_cluster": dataSourceAwsRdsCluster(), - "aws_rds_engine_version": dataSourceAwsRdsEngineVersion(), - "aws_rds_orderable_db_instance": dataSourceAwsRdsOrderableDbInstance(), - "aws_redshift_cluster": dataSourceAwsRedshiftCluster(), - "aws_redshift_orderable_cluster": dataSourceAwsRedshiftOrderableCluster(), - "aws_redshift_service_account": dataSourceAwsRedshiftServiceAccount(), - "aws_region": dataSourceAwsRegion(), - "aws_regions": dataSourceAwsRegions(), - "aws_route": dataSourceAwsRoute(), - "aws_route_table": dataSourceAwsRouteTable(), - "aws_route_tables": dataSourceAwsRouteTables(), - "aws_route53_delegation_set": dataSourceAwsDelegationSet(), - "aws_route53_resolver_endpoint": dataSourceAwsRoute53ResolverEndpoint(), - "aws_route53_resolver_rule": dataSourceAwsRoute53ResolverRule(), - "aws_route53_resolver_rules": dataSourceAwsRoute53ResolverRules(), - "aws_route53_zone": dataSourceAwsRoute53Zone(), - "aws_s3_bucket": dataSourceAwsS3Bucket(), - "aws_s3_bucket_object": dataSourceAwsS3BucketObject(), - "aws_s3_bucket_objects": dataSourceAwsS3BucketObjects(), - "aws_sagemaker_prebuilt_ecr_image": dataSourceAwsSageMakerPrebuiltECRImage(), - "aws_secretsmanager_secret": dataSourceAwsSecretsManagerSecret(), - "aws_secretsmanager_secret_rotation": dataSourceAwsSecretsManagerSecretRotation(), - "aws_secretsmanager_secret_version": dataSourceAwsSecretsManagerSecretVersion(), - "aws_serverlessrepository_application": dataSourceAwsServerlessRepositoryApplication(), - "aws_servicequotas_service": dataSourceAwsServiceQuotasService(), - "aws_servicequotas_service_quota": dataSourceAwsServiceQuotasServiceQuota(), - "aws_sfn_activity": dataSourceAwsSfnActivity(), - "aws_sfn_state_machine": dataSourceAwsSfnStateMachine(), - "aws_sns_topic": dataSourceAwsSnsTopic(), - "aws_sqs_queue": dataSourceAwsSqsQueue(), - "aws_ssm_document": dataSourceAwsSsmDocument(), - "aws_ssm_parameter": dataSourceAwsSsmParameter(), - "aws_ssm_patch_baseline": dataSourceAwsSsmPatchBaseline(), - "aws_storagegateway_local_disk": dataSourceAwsStorageGatewayLocalDisk(), - "aws_subnet": dataSourceAwsSubnet(), - "aws_subnet_ids": dataSourceAwsSubnetIDs(), - "aws_transfer_server": dataSourceAwsTransferServer(), - "aws_vpcs": dataSourceAwsVpcs(), - "aws_security_group": dataSourceAwsSecurityGroup(), - "aws_security_groups": dataSourceAwsSecurityGroups(), - "aws_vpc": dataSourceAwsVpc(), - "aws_vpc_dhcp_options": dataSourceAwsVpcDhcpOptions(), - "aws_vpc_endpoint": dataSourceAwsVpcEndpoint(), - "aws_vpc_endpoint_service": dataSourceAwsVpcEndpointService(), - "aws_vpc_peering_connection": dataSourceAwsVpcPeeringConnection(), - "aws_vpc_peering_connections": dataSourceAwsVpcPeeringConnections(), - "aws_vpn_gateway": dataSourceAwsVpnGateway(), - "aws_waf_ipset": dataSourceAwsWafIpSet(), - "aws_waf_rule": dataSourceAwsWafRule(), - "aws_waf_rate_based_rule": dataSourceAwsWafRateBasedRule(), - "aws_waf_web_acl": dataSourceAwsWafWebAcl(), - "aws_wafregional_ipset": dataSourceAwsWafRegionalIpSet(), - "aws_wafregional_rule": dataSourceAwsWafRegionalRule(), - "aws_wafregional_rate_based_rule": dataSourceAwsWafRegionalRateBasedRule(), - "aws_wafregional_web_acl": dataSourceAwsWafRegionalWebAcl(), - "aws_wafv2_ip_set": dataSourceAwsWafv2IPSet(), - "aws_wafv2_regex_pattern_set": dataSourceAwsWafv2RegexPatternSet(), - "aws_wafv2_rule_group": dataSourceAwsWafv2RuleGroup(), - "aws_wafv2_web_acl": dataSourceAwsWafv2WebACL(), - "aws_workspaces_bundle": dataSourceAwsWorkspacesBundle(), - "aws_workspaces_directory": dataSourceAwsWorkspacesDirectory(), - "aws_workspaces_image": dataSourceAwsWorkspacesImage(), - "aws_workspaces_workspace": dataSourceAwsWorkspacesWorkspace(), + "aws_acm_certificate": dataSourceAwsAcmCertificate(), + "aws_acmpca_certificate_authority": dataSourceAwsAcmpcaCertificateAuthority(), + "aws_ami": dataSourceAwsAmi(), + "aws_ami_ids": dataSourceAwsAmiIds(), + "aws_api_gateway_api_key": dataSourceAwsApiGatewayApiKey(), + "aws_api_gateway_resource": dataSourceAwsApiGatewayResource(), + "aws_api_gateway_rest_api": dataSourceAwsApiGatewayRestApi(), + "aws_api_gateway_vpc_link": dataSourceAwsApiGatewayVpcLink(), + "aws_arn": dataSourceAwsArn(), + "aws_autoscaling_group": dataSourceAwsAutoscalingGroup(), + "aws_autoscaling_groups": dataSourceAwsAutoscalingGroups(), + "aws_availability_zone": dataSourceAwsAvailabilityZone(), + "aws_availability_zones": dataSourceAwsAvailabilityZones(), + "aws_backup_plan": dataSourceAwsBackupPlan(), + "aws_backup_selection": dataSourceAwsBackupSelection(), + "aws_backup_vault": dataSourceAwsBackupVault(), + "aws_batch_compute_environment": dataSourceAwsBatchComputeEnvironment(), + "aws_batch_job_queue": dataSourceAwsBatchJobQueue(), + "aws_billing_service_account": dataSourceAwsBillingServiceAccount(), + "aws_caller_identity": dataSourceAwsCallerIdentity(), + "aws_canonical_user_id": dataSourceAwsCanonicalUserId(), + "aws_cloudformation_export": dataSourceAwsCloudFormationExport(), + "aws_cloudformation_stack": dataSourceAwsCloudFormationStack(), + "aws_cloudfront_distribution": dataSourceAwsCloudFrontDistribution(), + "aws_cloudhsm_v2_cluster": dataSourceCloudHsmV2Cluster(), + "aws_cloudtrail_service_account": dataSourceAwsCloudTrailServiceAccount(), + "aws_cloudwatch_log_group": dataSourceAwsCloudwatchLogGroup(), + "aws_codeartifact_authorization_token": dataSourceAwsCodeArtifactAuthorizationToken(), + "aws_codeartifact_repository_endpoint": dataSourceAwsCodeArtifactRepositoryEndpoint(), + "aws_cognito_user_pools": dataSourceAwsCognitoUserPools(), + "aws_codecommit_repository": dataSourceAwsCodeCommitRepository(), + "aws_cur_report_definition": dataSourceAwsCurReportDefinition(), + "aws_db_cluster_snapshot": dataSourceAwsDbClusterSnapshot(), + "aws_db_event_categories": dataSourceAwsDbEventCategories(), + "aws_db_instance": dataSourceAwsDbInstance(), + "aws_db_snapshot": dataSourceAwsDbSnapshot(), + "aws_db_subnet_group": dataSourceAwsDbSubnetGroup(), + "aws_directory_service_directory": dataSourceAwsDirectoryServiceDirectory(), + "aws_docdb_engine_version": dataSourceAwsDocdbEngineVersion(), + "aws_docdb_orderable_db_instance": dataSourceAwsDocdbOrderableDbInstance(), + "aws_dx_gateway": dataSourceAwsDxGateway(), + "aws_dynamodb_table": dataSourceAwsDynamoDbTable(), + "aws_ebs_default_kms_key": dataSourceAwsEbsDefaultKmsKey(), + "aws_ebs_encryption_by_default": dataSourceAwsEbsEncryptionByDefault(), + "aws_ebs_snapshot": dataSourceAwsEbsSnapshot(), + "aws_ebs_snapshot_ids": dataSourceAwsEbsSnapshotIds(), + "aws_ebs_volume": dataSourceAwsEbsVolume(), + "aws_ebs_volumes": dataSourceAwsEbsVolumes(), + "aws_ec2_coip_pool": dataSourceAwsEc2CoipPool(), + "aws_ec2_coip_pools": dataSourceAwsEc2CoipPools(), + "aws_ec2_instance_type": dataSourceAwsEc2InstanceType(), + "aws_ec2_instance_type_offering": dataSourceAwsEc2InstanceTypeOffering(), + "aws_ec2_instance_type_offerings": dataSourceAwsEc2InstanceTypeOfferings(), + "aws_ec2_local_gateway": dataSourceAwsEc2LocalGateway(), + "aws_ec2_local_gateways": dataSourceAwsEc2LocalGateways(), + "aws_ec2_local_gateway_route_table": dataSourceAwsEc2LocalGatewayRouteTable(), + "aws_ec2_local_gateway_route_tables": dataSourceAwsEc2LocalGatewayRouteTables(), + "aws_ec2_local_gateway_virtual_interface": dataSourceAwsEc2LocalGatewayVirtualInterface(), + "aws_ec2_local_gateway_virtual_interface_group": dataSourceAwsEc2LocalGatewayVirtualInterfaceGroup(), + "aws_ec2_local_gateway_virtual_interface_groups": dataSourceAwsEc2LocalGatewayVirtualInterfaceGroups(), + "aws_ec2_spot_price": dataSourceAwsEc2SpotPrice(), + "aws_ec2_transit_gateway": dataSourceAwsEc2TransitGateway(), + "aws_ec2_transit_gateway_dx_gateway_attachment": dataSourceAwsEc2TransitGatewayDxGatewayAttachment(), + "aws_ec2_transit_gateway_peering_attachment": dataSourceAwsEc2TransitGatewayPeeringAttachment(), + "aws_ec2_transit_gateway_route_table": dataSourceAwsEc2TransitGatewayRouteTable(), + "aws_ec2_transit_gateway_vpc_attachment": dataSourceAwsEc2TransitGatewayVpcAttachment(), + "aws_ec2_transit_gateway_vpn_attachment": dataSourceAwsEc2TransitGatewayVpnAttachment(), + "aws_ecr_authorization_token": dataSourceAwsEcrAuthorizationToken(), + "aws_ecr_image": dataSourceAwsEcrImage(), + "aws_ecr_repository": dataSourceAwsEcrRepository(), + "aws_ecs_cluster": dataSourceAwsEcsCluster(), + "aws_ecs_container_definition": dataSourceAwsEcsContainerDefinition(), + "aws_ecs_service": dataSourceAwsEcsService(), + "aws_ecs_task_definition": dataSourceAwsEcsTaskDefinition(), + "aws_customer_gateway": dataSourceAwsCustomerGateway(), + "aws_efs_access_point": dataSourceAwsEfsAccessPoint(), + "aws_efs_access_points": dataSourceAwsEfsAccessPoints(), + "aws_efs_file_system": dataSourceAwsEfsFileSystem(), + "aws_efs_mount_target": dataSourceAwsEfsMountTarget(), + "aws_eip": dataSourceAwsEip(), + "aws_eks_cluster": dataSourceAwsEksCluster(), + "aws_eks_cluster_auth": dataSourceAwsEksClusterAuth(), + "aws_elastic_beanstalk_application": dataSourceAwsElasticBeanstalkApplication(), + "aws_elastic_beanstalk_hosted_zone": dataSourceAwsElasticBeanstalkHostedZone(), + "aws_elastic_beanstalk_solution_stack": dataSourceAwsElasticBeanstalkSolutionStack(), + "aws_elasticache_cluster": dataSourceAwsElastiCacheCluster(), + "aws_elasticsearch_domain": dataSourceAwsElasticSearchDomain(), + "aws_elb": dataSourceAwsElb(), + "aws_elasticache_replication_group": dataSourceAwsElasticacheReplicationGroup(), + "aws_elb_hosted_zone_id": dataSourceAwsElbHostedZoneId(), + "aws_elb_service_account": dataSourceAwsElbServiceAccount(), + "aws_glue_script": dataSourceAwsGlueScript(), + "aws_guardduty_detector": dataSourceAwsGuarddutyDetector(), + "aws_iam_account_alias": dataSourceAwsIamAccountAlias(), + "aws_iam_group": dataSourceAwsIAMGroup(), + "aws_iam_instance_profile": dataSourceAwsIAMInstanceProfile(), + "aws_iam_policy": dataSourceAwsIAMPolicy(), + "aws_iam_policy_document": dataSourceAwsIamPolicyDocument(), + "aws_iam_role": dataSourceAwsIAMRole(), + "aws_iam_server_certificate": dataSourceAwsIAMServerCertificate(), + "aws_iam_user": dataSourceAwsIAMUser(), + "aws_imagebuilder_component": dataSourceAwsImageBuilderComponent(), + "aws_imagebuilder_distribution_configuration": datasourceAwsImageBuilderDistributionConfiguration(), + "aws_imagebuilder_infrastructure_configuration": datasourceAwsImageBuilderInfrastructureConfiguration(), + "aws_internet_gateway": dataSourceAwsInternetGateway(), + "aws_iot_endpoint": dataSourceAwsIotEndpoint(), + "aws_inspector_rules_packages": dataSourceAwsInspectorRulesPackages(), + "aws_instance": dataSourceAwsInstance(), + "aws_instances": dataSourceAwsInstances(), + "aws_ip_ranges": dataSourceAwsIPRanges(), + "aws_kinesis_stream": dataSourceAwsKinesisStream(), + "aws_kms_alias": dataSourceAwsKmsAlias(), + "aws_kms_ciphertext": dataSourceAwsKmsCiphertext(), + "aws_kms_key": dataSourceAwsKmsKey(), + "aws_kms_secret": dataSourceAwsKmsSecret(), + "aws_kms_secrets": dataSourceAwsKmsSecrets(), + "aws_lambda_alias": dataSourceAwsLambdaAlias(), + "aws_lambda_function": dataSourceAwsLambdaFunction(), + "aws_lambda_invocation": dataSourceAwsLambdaInvocation(), + "aws_lambda_layer_version": dataSourceAwsLambdaLayerVersion(), + "aws_launch_configuration": dataSourceAwsLaunchConfiguration(), + "aws_launch_template": dataSourceAwsLaunchTemplate(), + "aws_lex_bot": dataSourceAwsLexBot(), + "aws_lex_bot_alias": dataSourceAwsLexBotAlias(), + "aws_lex_intent": dataSourceAwsLexIntent(), + "aws_lex_slot_type": dataSourceAwsLexSlotType(), + "aws_mq_broker": dataSourceAwsMqBroker(), + "aws_msk_cluster": dataSourceAwsMskCluster(), + "aws_msk_configuration": dataSourceAwsMskConfiguration(), + "aws_nat_gateway": dataSourceAwsNatGateway(), + "aws_neptune_orderable_db_instance": dataSourceAwsNeptuneOrderableDbInstance(), + "aws_neptune_engine_version": dataSourceAwsNeptuneEngineVersion(), + "aws_network_acls": dataSourceAwsNetworkAcls(), + "aws_network_interface": dataSourceAwsNetworkInterface(), + "aws_network_interfaces": dataSourceAwsNetworkInterfaces(), + "aws_organizations_organization": dataSourceAwsOrganizationsOrganization(), + "aws_organizations_organizational_units": dataSourceAwsOrganizationsOrganizationalUnits(), + "aws_outposts_outpost": dataSourceAwsOutpostsOutpost(), + "aws_outposts_outpost_instance_type": dataSourceAwsOutpostsOutpostInstanceType(), + "aws_outposts_outpost_instance_types": dataSourceAwsOutpostsOutpostInstanceTypes(), + "aws_outposts_outposts": dataSourceAwsOutpostsOutposts(), + "aws_outposts_site": dataSourceAwsOutpostsSite(), + "aws_outposts_sites": dataSourceAwsOutpostsSites(), + "aws_partition": dataSourceAwsPartition(), + "aws_prefix_list": dataSourceAwsPrefixList(), + "aws_pricing_product": dataSourceAwsPricingProduct(), + "aws_qldb_ledger": dataSourceAwsQLDBLedger(), + "aws_ram_resource_share": dataSourceAwsRamResourceShare(), + "aws_rds_certificate": dataSourceAwsRdsCertificate(), + "aws_rds_cluster": dataSourceAwsRdsCluster(), + "aws_rds_engine_version": dataSourceAwsRdsEngineVersion(), + "aws_rds_orderable_db_instance": dataSourceAwsRdsOrderableDbInstance(), + "aws_redshift_cluster": dataSourceAwsRedshiftCluster(), + "aws_redshift_orderable_cluster": dataSourceAwsRedshiftOrderableCluster(), + "aws_redshift_service_account": dataSourceAwsRedshiftServiceAccount(), + "aws_region": dataSourceAwsRegion(), + "aws_regions": dataSourceAwsRegions(), + "aws_route": dataSourceAwsRoute(), + "aws_route_table": dataSourceAwsRouteTable(), + "aws_route_tables": dataSourceAwsRouteTables(), + "aws_route53_delegation_set": dataSourceAwsDelegationSet(), + "aws_route53_resolver_endpoint": dataSourceAwsRoute53ResolverEndpoint(), + "aws_route53_resolver_rule": dataSourceAwsRoute53ResolverRule(), + "aws_route53_resolver_rules": dataSourceAwsRoute53ResolverRules(), + "aws_route53_zone": dataSourceAwsRoute53Zone(), + "aws_s3_bucket": dataSourceAwsS3Bucket(), + "aws_s3_bucket_object": dataSourceAwsS3BucketObject(), + "aws_s3_bucket_objects": dataSourceAwsS3BucketObjects(), + "aws_sagemaker_prebuilt_ecr_image": dataSourceAwsSageMakerPrebuiltECRImage(), + "aws_secretsmanager_secret": dataSourceAwsSecretsManagerSecret(), + "aws_secretsmanager_secret_rotation": dataSourceAwsSecretsManagerSecretRotation(), + "aws_secretsmanager_secret_version": dataSourceAwsSecretsManagerSecretVersion(), + "aws_serverlessapplicationrepository_application": dataSourceAwsServerlessApplicationRepositoryApplication(), + "aws_servicequotas_service": dataSourceAwsServiceQuotasService(), + "aws_servicequotas_service_quota": dataSourceAwsServiceQuotasServiceQuota(), + "aws_sfn_activity": dataSourceAwsSfnActivity(), + "aws_sfn_state_machine": dataSourceAwsSfnStateMachine(), + "aws_sns_topic": dataSourceAwsSnsTopic(), + "aws_sqs_queue": dataSourceAwsSqsQueue(), + "aws_ssm_document": dataSourceAwsSsmDocument(), + "aws_ssm_parameter": dataSourceAwsSsmParameter(), + "aws_ssm_patch_baseline": dataSourceAwsSsmPatchBaseline(), + "aws_storagegateway_local_disk": dataSourceAwsStorageGatewayLocalDisk(), + "aws_subnet": dataSourceAwsSubnet(), + "aws_subnet_ids": dataSourceAwsSubnetIDs(), + "aws_transfer_server": dataSourceAwsTransferServer(), + "aws_vpcs": dataSourceAwsVpcs(), + "aws_security_group": dataSourceAwsSecurityGroup(), + "aws_security_groups": dataSourceAwsSecurityGroups(), + "aws_vpc": dataSourceAwsVpc(), + "aws_vpc_dhcp_options": dataSourceAwsVpcDhcpOptions(), + "aws_vpc_endpoint": dataSourceAwsVpcEndpoint(), + "aws_vpc_endpoint_service": dataSourceAwsVpcEndpointService(), + "aws_vpc_peering_connection": dataSourceAwsVpcPeeringConnection(), + "aws_vpc_peering_connections": dataSourceAwsVpcPeeringConnections(), + "aws_vpn_gateway": dataSourceAwsVpnGateway(), + "aws_waf_ipset": dataSourceAwsWafIpSet(), + "aws_waf_rule": dataSourceAwsWafRule(), + "aws_waf_rate_based_rule": dataSourceAwsWafRateBasedRule(), + "aws_waf_web_acl": dataSourceAwsWafWebAcl(), + "aws_wafregional_ipset": dataSourceAwsWafRegionalIpSet(), + "aws_wafregional_rule": dataSourceAwsWafRegionalRule(), + "aws_wafregional_rate_based_rule": dataSourceAwsWafRegionalRateBasedRule(), + "aws_wafregional_web_acl": dataSourceAwsWafRegionalWebAcl(), + "aws_wafv2_ip_set": dataSourceAwsWafv2IPSet(), + "aws_wafv2_regex_pattern_set": dataSourceAwsWafv2RegexPatternSet(), + "aws_wafv2_rule_group": dataSourceAwsWafv2RuleGroup(), + "aws_wafv2_web_acl": dataSourceAwsWafv2WebACL(), + "aws_workspaces_bundle": dataSourceAwsWorkspacesBundle(), + "aws_workspaces_directory": dataSourceAwsWorkspacesDirectory(), + "aws_workspaces_image": dataSourceAwsWorkspacesImage(), + "aws_workspaces_workspace": dataSourceAwsWorkspacesWorkspace(), // Adding the Aliases for the ALB -> LB Rename "aws_lb": dataSourceAwsLb(), @@ -388,632 +388,632 @@ func Provider() *schema.Provider { }, ResourcesMap: map[string]*schema.Resource{ - "aws_accessanalyzer_analyzer": resourceAwsAccessAnalyzerAnalyzer(), - "aws_acm_certificate": resourceAwsAcmCertificate(), - "aws_acm_certificate_validation": resourceAwsAcmCertificateValidation(), - "aws_acmpca_certificate_authority": resourceAwsAcmpcaCertificateAuthority(), - "aws_ami": resourceAwsAmi(), - "aws_ami_copy": resourceAwsAmiCopy(), - "aws_ami_from_instance": resourceAwsAmiFromInstance(), - "aws_ami_launch_permission": resourceAwsAmiLaunchPermission(), - "aws_api_gateway_account": resourceAwsApiGatewayAccount(), - "aws_api_gateway_api_key": resourceAwsApiGatewayApiKey(), - "aws_api_gateway_authorizer": resourceAwsApiGatewayAuthorizer(), - "aws_api_gateway_base_path_mapping": resourceAwsApiGatewayBasePathMapping(), - "aws_api_gateway_client_certificate": resourceAwsApiGatewayClientCertificate(), - "aws_api_gateway_deployment": resourceAwsApiGatewayDeployment(), - "aws_api_gateway_documentation_part": resourceAwsApiGatewayDocumentationPart(), - "aws_api_gateway_documentation_version": resourceAwsApiGatewayDocumentationVersion(), - "aws_api_gateway_domain_name": resourceAwsApiGatewayDomainName(), - "aws_api_gateway_gateway_response": resourceAwsApiGatewayGatewayResponse(), - "aws_api_gateway_integration": resourceAwsApiGatewayIntegration(), - "aws_api_gateway_integration_response": resourceAwsApiGatewayIntegrationResponse(), - "aws_api_gateway_method": resourceAwsApiGatewayMethod(), - "aws_api_gateway_method_response": resourceAwsApiGatewayMethodResponse(), - "aws_api_gateway_method_settings": resourceAwsApiGatewayMethodSettings(), - "aws_api_gateway_model": resourceAwsApiGatewayModel(), - "aws_api_gateway_request_validator": resourceAwsApiGatewayRequestValidator(), - "aws_api_gateway_resource": resourceAwsApiGatewayResource(), - "aws_api_gateway_rest_api": resourceAwsApiGatewayRestApi(), - "aws_api_gateway_rest_api_policy": resourceAwsApiGatewayRestApiPolicy(), - "aws_api_gateway_stage": resourceAwsApiGatewayStage(), - "aws_api_gateway_usage_plan": resourceAwsApiGatewayUsagePlan(), - "aws_api_gateway_usage_plan_key": resourceAwsApiGatewayUsagePlanKey(), - "aws_api_gateway_vpc_link": resourceAwsApiGatewayVpcLink(), - "aws_apigatewayv2_api": resourceAwsApiGatewayV2Api(), - "aws_apigatewayv2_api_mapping": resourceAwsApiGatewayV2ApiMapping(), - "aws_apigatewayv2_authorizer": resourceAwsApiGatewayV2Authorizer(), - "aws_apigatewayv2_deployment": resourceAwsApiGatewayV2Deployment(), - "aws_apigatewayv2_domain_name": resourceAwsApiGatewayV2DomainName(), - "aws_apigatewayv2_integration": resourceAwsApiGatewayV2Integration(), - "aws_apigatewayv2_integration_response": resourceAwsApiGatewayV2IntegrationResponse(), - "aws_apigatewayv2_model": resourceAwsApiGatewayV2Model(), - "aws_apigatewayv2_route": resourceAwsApiGatewayV2Route(), - "aws_apigatewayv2_route_response": resourceAwsApiGatewayV2RouteResponse(), - "aws_apigatewayv2_stage": resourceAwsApiGatewayV2Stage(), - "aws_apigatewayv2_vpc_link": resourceAwsApiGatewayV2VpcLink(), - "aws_app_cookie_stickiness_policy": resourceAwsAppCookieStickinessPolicy(), - "aws_appautoscaling_target": resourceAwsAppautoscalingTarget(), - "aws_appautoscaling_policy": resourceAwsAppautoscalingPolicy(), - "aws_appautoscaling_scheduled_action": resourceAwsAppautoscalingScheduledAction(), - "aws_appmesh_gateway_route": resourceAwsAppmeshGatewayRoute(), - "aws_appmesh_mesh": resourceAwsAppmeshMesh(), - "aws_appmesh_route": resourceAwsAppmeshRoute(), - "aws_appmesh_virtual_gateway": resourceAwsAppmeshVirtualGateway(), - "aws_appmesh_virtual_node": resourceAwsAppmeshVirtualNode(), - "aws_appmesh_virtual_router": resourceAwsAppmeshVirtualRouter(), - "aws_appmesh_virtual_service": resourceAwsAppmeshVirtualService(), - "aws_appsync_api_key": resourceAwsAppsyncApiKey(), - "aws_appsync_datasource": resourceAwsAppsyncDatasource(), - "aws_appsync_function": resourceAwsAppsyncFunction(), - "aws_appsync_graphql_api": resourceAwsAppsyncGraphqlApi(), - "aws_appsync_resolver": resourceAwsAppsyncResolver(), - "aws_athena_database": resourceAwsAthenaDatabase(), - "aws_athena_named_query": resourceAwsAthenaNamedQuery(), - "aws_athena_workgroup": resourceAwsAthenaWorkgroup(), - "aws_autoscaling_attachment": resourceAwsAutoscalingAttachment(), - "aws_autoscaling_group": resourceAwsAutoscalingGroup(), - "aws_autoscaling_lifecycle_hook": resourceAwsAutoscalingLifecycleHook(), - "aws_autoscaling_notification": resourceAwsAutoscalingNotification(), - "aws_autoscaling_policy": resourceAwsAutoscalingPolicy(), - "aws_autoscaling_schedule": resourceAwsAutoscalingSchedule(), - "aws_autoscalingplans_scaling_plan": resourceAwsAutoScalingPlansScalingPlan(), - "aws_backup_plan": resourceAwsBackupPlan(), - "aws_backup_selection": resourceAwsBackupSelection(), - "aws_backup_vault": resourceAwsBackupVault(), - "aws_backup_vault_notifications": resourceAwsBackupVaultNotifications(), - "aws_backup_vault_policy": resourceAwsBackupVaultPolicy(), - "aws_budgets_budget": resourceAwsBudgetsBudget(), - "aws_cloud9_environment_ec2": resourceAwsCloud9EnvironmentEc2(), - "aws_cloudformation_stack": resourceAwsCloudFormationStack(), - "aws_cloudformation_stack_set": resourceAwsCloudFormationStackSet(), - "aws_cloudformation_stack_set_instance": resourceAwsCloudFormationStackSetInstance(), - "aws_cloudfront_distribution": resourceAwsCloudFrontDistribution(), - "aws_cloudfront_origin_access_identity": resourceAwsCloudFrontOriginAccessIdentity(), - "aws_cloudfront_public_key": resourceAwsCloudFrontPublicKey(), - "aws_cloudtrail": resourceAwsCloudTrail(), - "aws_cloudwatch_event_bus": resourceAwsCloudWatchEventBus(), - "aws_cloudwatch_event_permission": resourceAwsCloudWatchEventPermission(), - "aws_cloudwatch_event_rule": resourceAwsCloudWatchEventRule(), - "aws_cloudwatch_event_target": resourceAwsCloudWatchEventTarget(), - "aws_cloudwatch_log_destination": resourceAwsCloudWatchLogDestination(), - "aws_cloudwatch_log_destination_policy": resourceAwsCloudWatchLogDestinationPolicy(), - "aws_cloudwatch_log_group": resourceAwsCloudWatchLogGroup(), - "aws_cloudwatch_log_metric_filter": resourceAwsCloudWatchLogMetricFilter(), - "aws_cloudwatch_log_resource_policy": resourceAwsCloudWatchLogResourcePolicy(), - "aws_cloudwatch_log_stream": resourceAwsCloudWatchLogStream(), - "aws_cloudwatch_log_subscription_filter": resourceAwsCloudwatchLogSubscriptionFilter(), - "aws_config_aggregate_authorization": resourceAwsConfigAggregateAuthorization(), - "aws_config_config_rule": resourceAwsConfigConfigRule(), - "aws_config_configuration_aggregator": resourceAwsConfigConfigurationAggregator(), - "aws_config_configuration_recorder": resourceAwsConfigConfigurationRecorder(), - "aws_config_configuration_recorder_status": resourceAwsConfigConfigurationRecorderStatus(), - "aws_config_delivery_channel": resourceAwsConfigDeliveryChannel(), - "aws_config_organization_custom_rule": resourceAwsConfigOrganizationCustomRule(), - "aws_config_organization_managed_rule": resourceAwsConfigOrganizationManagedRule(), - "aws_config_remediation_configuration": resourceAwsConfigRemediationConfiguration(), - "aws_cognito_identity_pool": resourceAwsCognitoIdentityPool(), - "aws_cognito_identity_pool_roles_attachment": resourceAwsCognitoIdentityPoolRolesAttachment(), - "aws_cognito_identity_provider": resourceAwsCognitoIdentityProvider(), - "aws_cognito_user_group": resourceAwsCognitoUserGroup(), - "aws_cognito_user_pool": resourceAwsCognitoUserPool(), - "aws_cognito_user_pool_client": resourceAwsCognitoUserPoolClient(), - "aws_cognito_user_pool_domain": resourceAwsCognitoUserPoolDomain(), - "aws_cloudhsm_v2_cluster": resourceAwsCloudHsmV2Cluster(), - "aws_cloudhsm_v2_hsm": resourceAwsCloudHsmV2Hsm(), - "aws_cognito_resource_server": resourceAwsCognitoResourceServer(), - "aws_cloudwatch_metric_alarm": resourceAwsCloudWatchMetricAlarm(), - "aws_cloudwatch_dashboard": resourceAwsCloudWatchDashboard(), - "aws_codedeploy_app": resourceAwsCodeDeployApp(), - "aws_codedeploy_deployment_config": resourceAwsCodeDeployDeploymentConfig(), - "aws_codedeploy_deployment_group": resourceAwsCodeDeployDeploymentGroup(), - "aws_codecommit_repository": resourceAwsCodeCommitRepository(), - "aws_codecommit_trigger": resourceAwsCodeCommitTrigger(), - "aws_codeartifact_domain": resourceAwsCodeArtifactDomain(), - "aws_codeartifact_domain_permissions_policy": resourceAwsCodeArtifactDomainPermissionsPolicy(), - "aws_codeartifact_repository": resourceAwsCodeArtifactRepository(), - "aws_codeartifact_repository_permissions_policy": resourceAwsCodeArtifactRepositoryPermissionsPolicy(), - "aws_codebuild_project": resourceAwsCodeBuildProject(), - "aws_codebuild_report_group": resourceAwsCodeBuildReportGroup(), - "aws_codebuild_source_credential": resourceAwsCodeBuildSourceCredential(), - "aws_codebuild_webhook": resourceAwsCodeBuildWebhook(), - "aws_codepipeline": resourceAwsCodePipeline(), - "aws_codepipeline_webhook": resourceAwsCodePipelineWebhook(), - "aws_codestarnotifications_notification_rule": resourceAwsCodeStarNotificationsNotificationRule(), - "aws_cur_report_definition": resourceAwsCurReportDefinition(), - "aws_customer_gateway": resourceAwsCustomerGateway(), - "aws_datapipeline_pipeline": resourceAwsDataPipelinePipeline(), - "aws_datasync_agent": resourceAwsDataSyncAgent(), - "aws_datasync_location_efs": resourceAwsDataSyncLocationEfs(), - "aws_datasync_location_fsx_windows_file_system": resourceAwsDataSyncLocationFsxWindowsFileSystem(), - "aws_datasync_location_nfs": resourceAwsDataSyncLocationNfs(), - "aws_datasync_location_s3": resourceAwsDataSyncLocationS3(), - "aws_datasync_location_smb": resourceAwsDataSyncLocationSmb(), - "aws_datasync_task": resourceAwsDataSyncTask(), - "aws_dax_cluster": resourceAwsDaxCluster(), - "aws_dax_parameter_group": resourceAwsDaxParameterGroup(), - "aws_dax_subnet_group": resourceAwsDaxSubnetGroup(), - "aws_db_cluster_snapshot": resourceAwsDbClusterSnapshot(), - "aws_db_event_subscription": resourceAwsDbEventSubscription(), - "aws_db_instance": resourceAwsDbInstance(), - "aws_db_instance_role_association": resourceAwsDbInstanceRoleAssociation(), - "aws_db_option_group": resourceAwsDbOptionGroup(), - "aws_db_parameter_group": resourceAwsDbParameterGroup(), - "aws_db_proxy": resourceAwsDbProxy(), - "aws_db_proxy_default_target_group": resourceAwsDbProxyDefaultTargetGroup(), - "aws_db_proxy_target": resourceAwsDbProxyTarget(), - "aws_db_security_group": resourceAwsDbSecurityGroup(), - "aws_db_snapshot": resourceAwsDbSnapshot(), - "aws_db_subnet_group": resourceAwsDbSubnetGroup(), - "aws_devicefarm_project": resourceAwsDevicefarmProject(), - "aws_directory_service_directory": resourceAwsDirectoryServiceDirectory(), - "aws_directory_service_conditional_forwarder": resourceAwsDirectoryServiceConditionalForwarder(), - "aws_directory_service_log_subscription": resourceAwsDirectoryServiceLogSubscription(), - "aws_dlm_lifecycle_policy": resourceAwsDlmLifecyclePolicy(), - "aws_dms_certificate": resourceAwsDmsCertificate(), - "aws_dms_endpoint": resourceAwsDmsEndpoint(), - "aws_dms_event_subscription": resourceAwsDmsEventSubscription(), - "aws_dms_replication_instance": resourceAwsDmsReplicationInstance(), - "aws_dms_replication_subnet_group": resourceAwsDmsReplicationSubnetGroup(), - "aws_dms_replication_task": resourceAwsDmsReplicationTask(), - "aws_docdb_cluster": resourceAwsDocDBCluster(), - "aws_docdb_cluster_instance": resourceAwsDocDBClusterInstance(), - "aws_docdb_cluster_parameter_group": resourceAwsDocDBClusterParameterGroup(), - "aws_docdb_cluster_snapshot": resourceAwsDocDBClusterSnapshot(), - "aws_docdb_subnet_group": resourceAwsDocDBSubnetGroup(), - "aws_dx_bgp_peer": resourceAwsDxBgpPeer(), - "aws_dx_connection": resourceAwsDxConnection(), - "aws_dx_connection_association": resourceAwsDxConnectionAssociation(), - "aws_dx_gateway": resourceAwsDxGateway(), - "aws_dx_gateway_association": resourceAwsDxGatewayAssociation(), - "aws_dx_gateway_association_proposal": resourceAwsDxGatewayAssociationProposal(), - "aws_dx_hosted_private_virtual_interface": resourceAwsDxHostedPrivateVirtualInterface(), - "aws_dx_hosted_private_virtual_interface_accepter": resourceAwsDxHostedPrivateVirtualInterfaceAccepter(), - "aws_dx_hosted_public_virtual_interface": resourceAwsDxHostedPublicVirtualInterface(), - "aws_dx_hosted_public_virtual_interface_accepter": resourceAwsDxHostedPublicVirtualInterfaceAccepter(), - "aws_dx_hosted_transit_virtual_interface": resourceAwsDxHostedTransitVirtualInterface(), - "aws_dx_hosted_transit_virtual_interface_accepter": resourceAwsDxHostedTransitVirtualInterfaceAccepter(), - "aws_dx_lag": resourceAwsDxLag(), - "aws_dx_private_virtual_interface": resourceAwsDxPrivateVirtualInterface(), - "aws_dx_public_virtual_interface": resourceAwsDxPublicVirtualInterface(), - "aws_dx_transit_virtual_interface": resourceAwsDxTransitVirtualInterface(), - "aws_dynamodb_table": resourceAwsDynamoDbTable(), - "aws_dynamodb_table_item": resourceAwsDynamoDbTableItem(), - "aws_dynamodb_global_table": resourceAwsDynamoDbGlobalTable(), - "aws_ebs_default_kms_key": resourceAwsEbsDefaultKmsKey(), - "aws_ebs_encryption_by_default": resourceAwsEbsEncryptionByDefault(), - "aws_ebs_snapshot": resourceAwsEbsSnapshot(), - "aws_ebs_snapshot_copy": resourceAwsEbsSnapshotCopy(), - "aws_ebs_volume": resourceAwsEbsVolume(), - "aws_ec2_availability_zone_group": resourceAwsEc2AvailabilityZoneGroup(), - "aws_ec2_capacity_reservation": resourceAwsEc2CapacityReservation(), - "aws_ec2_client_vpn_authorization_rule": resourceAwsEc2ClientVpnAuthorizationRule(), - "aws_ec2_client_vpn_endpoint": resourceAwsEc2ClientVpnEndpoint(), - "aws_ec2_client_vpn_network_association": resourceAwsEc2ClientVpnNetworkAssociation(), - "aws_ec2_client_vpn_route": resourceAwsEc2ClientVpnRoute(), - "aws_ec2_fleet": resourceAwsEc2Fleet(), - "aws_ec2_local_gateway_route": resourceAwsEc2LocalGatewayRoute(), - "aws_ec2_local_gateway_route_table_vpc_association": resourceAwsEc2LocalGatewayRouteTableVpcAssociation(), - "aws_ec2_tag": resourceAwsEc2Tag(), - "aws_ec2_traffic_mirror_filter": resourceAwsEc2TrafficMirrorFilter(), - "aws_ec2_traffic_mirror_filter_rule": resourceAwsEc2TrafficMirrorFilterRule(), - "aws_ec2_traffic_mirror_target": resourceAwsEc2TrafficMirrorTarget(), - "aws_ec2_traffic_mirror_session": resourceAwsEc2TrafficMirrorSession(), - "aws_ec2_transit_gateway": resourceAwsEc2TransitGateway(), - "aws_ec2_transit_gateway_peering_attachment": resourceAwsEc2TransitGatewayPeeringAttachment(), - "aws_ec2_transit_gateway_peering_attachment_accepter": resourceAwsEc2TransitGatewayPeeringAttachmentAccepter(), - "aws_ec2_transit_gateway_route": resourceAwsEc2TransitGatewayRoute(), - "aws_ec2_transit_gateway_route_table": resourceAwsEc2TransitGatewayRouteTable(), - "aws_ec2_transit_gateway_route_table_association": resourceAwsEc2TransitGatewayRouteTableAssociation(), - "aws_ec2_transit_gateway_route_table_propagation": resourceAwsEc2TransitGatewayRouteTablePropagation(), - "aws_ec2_transit_gateway_vpc_attachment": resourceAwsEc2TransitGatewayVpcAttachment(), - "aws_ec2_transit_gateway_vpc_attachment_accepter": resourceAwsEc2TransitGatewayVpcAttachmentAccepter(), - "aws_ecr_lifecycle_policy": resourceAwsEcrLifecyclePolicy(), - "aws_ecr_repository": resourceAwsEcrRepository(), - "aws_ecr_repository_policy": resourceAwsEcrRepositoryPolicy(), - "aws_ecs_capacity_provider": resourceAwsEcsCapacityProvider(), - "aws_ecs_cluster": resourceAwsEcsCluster(), - "aws_ecs_service": resourceAwsEcsService(), - "aws_ecs_task_definition": resourceAwsEcsTaskDefinition(), - "aws_efs_access_point": resourceAwsEfsAccessPoint(), - "aws_efs_file_system": resourceAwsEfsFileSystem(), - "aws_efs_file_system_policy": resourceAwsEfsFileSystemPolicy(), - "aws_efs_mount_target": resourceAwsEfsMountTarget(), - "aws_egress_only_internet_gateway": resourceAwsEgressOnlyInternetGateway(), - "aws_eip": resourceAwsEip(), - "aws_eip_association": resourceAwsEipAssociation(), - "aws_eks_cluster": resourceAwsEksCluster(), - "aws_eks_fargate_profile": resourceAwsEksFargateProfile(), - "aws_eks_node_group": resourceAwsEksNodeGroup(), - "aws_elasticache_cluster": resourceAwsElasticacheCluster(), - "aws_elasticache_parameter_group": resourceAwsElasticacheParameterGroup(), - "aws_elasticache_replication_group": resourceAwsElasticacheReplicationGroup(), - "aws_elasticache_security_group": resourceAwsElasticacheSecurityGroup(), - "aws_elasticache_subnet_group": resourceAwsElasticacheSubnetGroup(), - "aws_elastic_beanstalk_application": resourceAwsElasticBeanstalkApplication(), - "aws_elastic_beanstalk_application_version": resourceAwsElasticBeanstalkApplicationVersion(), - "aws_elastic_beanstalk_configuration_template": resourceAwsElasticBeanstalkConfigurationTemplate(), - "aws_elastic_beanstalk_environment": resourceAwsElasticBeanstalkEnvironment(), - "aws_elasticsearch_domain": resourceAwsElasticSearchDomain(), - "aws_elasticsearch_domain_policy": resourceAwsElasticSearchDomainPolicy(), - "aws_elastictranscoder_pipeline": resourceAwsElasticTranscoderPipeline(), - "aws_elastictranscoder_preset": resourceAwsElasticTranscoderPreset(), - "aws_elb": resourceAwsElb(), - "aws_elb_attachment": resourceAwsElbAttachment(), - "aws_emr_cluster": resourceAwsEMRCluster(), - "aws_emr_instance_group": resourceAwsEMRInstanceGroup(), - "aws_emr_instance_fleet": resourceAwsEMRInstanceFleet(), - "aws_emr_managed_scaling_policy": resourceAwsEMRManagedScalingPolicy(), - "aws_emr_security_configuration": resourceAwsEMRSecurityConfiguration(), - "aws_flow_log": resourceAwsFlowLog(), - "aws_fsx_lustre_file_system": resourceAwsFsxLustreFileSystem(), - "aws_fsx_windows_file_system": resourceAwsFsxWindowsFileSystem(), - "aws_fms_admin_account": resourceAwsFmsAdminAccount(), - "aws_gamelift_alias": resourceAwsGameliftAlias(), - "aws_gamelift_build": resourceAwsGameliftBuild(), - "aws_gamelift_fleet": resourceAwsGameliftFleet(), - "aws_gamelift_game_session_queue": resourceAwsGameliftGameSessionQueue(), - "aws_glacier_vault": resourceAwsGlacierVault(), - "aws_glacier_vault_lock": resourceAwsGlacierVaultLock(), - "aws_globalaccelerator_accelerator": resourceAwsGlobalAcceleratorAccelerator(), - "aws_globalaccelerator_endpoint_group": resourceAwsGlobalAcceleratorEndpointGroup(), - "aws_globalaccelerator_listener": resourceAwsGlobalAcceleratorListener(), - "aws_glue_catalog_database": resourceAwsGlueCatalogDatabase(), - "aws_glue_catalog_table": resourceAwsGlueCatalogTable(), - "aws_glue_classifier": resourceAwsGlueClassifier(), - "aws_glue_connection": resourceAwsGlueConnection(), - "aws_glue_dev_endpoint": resourceAwsGlueDevEndpoint(), - "aws_glue_crawler": resourceAwsGlueCrawler(), - "aws_glue_data_catalog_encryption_settings": resourceAwsGlueDataCatalogEncryptionSettings(), - "aws_glue_job": resourceAwsGlueJob(), - "aws_glue_ml_transform": resourceAwsGlueMLTransform(), - "aws_glue_partition": resourceAwsGluePartition(), - "aws_glue_security_configuration": resourceAwsGlueSecurityConfiguration(), - "aws_glue_trigger": resourceAwsGlueTrigger(), - "aws_glue_user_defined_function": resourceAwsGlueUserDefinedFunction(), - "aws_glue_workflow": resourceAwsGlueWorkflow(), - "aws_glue_resource_policy": resourceAwsGlueResourcePolicy(), - "aws_guardduty_detector": resourceAwsGuardDutyDetector(), - "aws_guardduty_filter": resourceAwsGuardDutyFilter(), - "aws_guardduty_invite_accepter": resourceAwsGuardDutyInviteAccepter(), - "aws_guardduty_ipset": resourceAwsGuardDutyIpset(), - "aws_guardduty_member": resourceAwsGuardDutyMember(), - "aws_guardduty_organization_admin_account": resourceAwsGuardDutyOrganizationAdminAccount(), - "aws_guardduty_organization_configuration": resourceAwsGuardDutyOrganizationConfiguration(), - "aws_guardduty_publishing_destination": resourceAwsGuardDutyPublishingDestination(), - "aws_guardduty_threatintelset": resourceAwsGuardDutyThreatintelset(), - "aws_iam_access_key": resourceAwsIamAccessKey(), - "aws_iam_account_alias": resourceAwsIamAccountAlias(), - "aws_iam_account_password_policy": resourceAwsIamAccountPasswordPolicy(), - "aws_iam_group_policy": resourceAwsIamGroupPolicy(), - "aws_iam_group": resourceAwsIamGroup(), - "aws_iam_group_membership": resourceAwsIamGroupMembership(), - "aws_iam_group_policy_attachment": resourceAwsIamGroupPolicyAttachment(), - "aws_iam_instance_profile": resourceAwsIamInstanceProfile(), - "aws_iam_openid_connect_provider": resourceAwsIamOpenIDConnectProvider(), - "aws_iam_policy": resourceAwsIamPolicy(), - "aws_iam_policy_attachment": resourceAwsIamPolicyAttachment(), - "aws_iam_role_policy_attachment": resourceAwsIamRolePolicyAttachment(), - "aws_iam_role_policy": resourceAwsIamRolePolicy(), - "aws_iam_role": resourceAwsIamRole(), - "aws_iam_saml_provider": resourceAwsIamSamlProvider(), - "aws_iam_server_certificate": resourceAwsIAMServerCertificate(), - "aws_iam_service_linked_role": resourceAwsIamServiceLinkedRole(), - "aws_iam_user_group_membership": resourceAwsIamUserGroupMembership(), - "aws_iam_user_policy_attachment": resourceAwsIamUserPolicyAttachment(), - "aws_iam_user_policy": resourceAwsIamUserPolicy(), - "aws_iam_user_ssh_key": resourceAwsIamUserSshKey(), - "aws_iam_user": resourceAwsIamUser(), - "aws_iam_user_login_profile": resourceAwsIamUserLoginProfile(), - "aws_imagebuilder_component": resourceAwsImageBuilderComponent(), - "aws_imagebuilder_distribution_configuration": resourceAwsImageBuilderDistributionConfiguration(), - "aws_imagebuilder_infrastructure_configuration": resourceAwsImageBuilderInfrastructureConfiguration(), - "aws_inspector_assessment_target": resourceAWSInspectorAssessmentTarget(), - "aws_inspector_assessment_template": resourceAWSInspectorAssessmentTemplate(), - "aws_inspector_resource_group": resourceAWSInspectorResourceGroup(), - "aws_instance": resourceAwsInstance(), - "aws_internet_gateway": resourceAwsInternetGateway(), - "aws_iot_certificate": resourceAwsIotCertificate(), - "aws_iot_policy": resourceAwsIotPolicy(), - "aws_iot_policy_attachment": resourceAwsIotPolicyAttachment(), - "aws_iot_thing": resourceAwsIotThing(), - "aws_iot_thing_principal_attachment": resourceAwsIotThingPrincipalAttachment(), - "aws_iot_thing_type": resourceAwsIotThingType(), - "aws_iot_topic_rule": resourceAwsIotTopicRule(), - "aws_iot_role_alias": resourceAwsIotRoleAlias(), - "aws_key_pair": resourceAwsKeyPair(), - "aws_kinesis_analytics_application": resourceAwsKinesisAnalyticsApplication(), - "aws_kinesisanalyticsv2_application": resourceAwsKinesisAnalyticsV2Application(), - "aws_kinesis_firehose_delivery_stream": resourceAwsKinesisFirehoseDeliveryStream(), - "aws_kinesis_stream": resourceAwsKinesisStream(), - "aws_kinesis_video_stream": resourceAwsKinesisVideoStream(), - "aws_kms_alias": resourceAwsKmsAlias(), - "aws_kms_external_key": resourceAwsKmsExternalKey(), - "aws_kms_grant": resourceAwsKmsGrant(), - "aws_kms_key": resourceAwsKmsKey(), - "aws_kms_ciphertext": resourceAwsKmsCiphertext(), - "aws_lambda_alias": resourceAwsLambdaAlias(), - "aws_lambda_event_source_mapping": resourceAwsLambdaEventSourceMapping(), - "aws_lambda_function_event_invoke_config": resourceAwsLambdaFunctionEventInvokeConfig(), - "aws_lambda_function": resourceAwsLambdaFunction(), - "aws_lambda_layer_version": resourceAwsLambdaLayerVersion(), - "aws_lambda_permission": resourceAwsLambdaPermission(), - "aws_lambda_provisioned_concurrency_config": resourceAwsLambdaProvisionedConcurrencyConfig(), - "aws_launch_configuration": resourceAwsLaunchConfiguration(), - "aws_launch_template": resourceAwsLaunchTemplate(), - "aws_lex_bot": resourceAwsLexBot(), - "aws_lex_bot_alias": resourceAwsLexBotAlias(), - "aws_lex_intent": resourceAwsLexIntent(), - "aws_lex_slot_type": resourceAwsLexSlotType(), - "aws_licensemanager_association": resourceAwsLicenseManagerAssociation(), - "aws_licensemanager_license_configuration": resourceAwsLicenseManagerLicenseConfiguration(), - "aws_lightsail_domain": resourceAwsLightsailDomain(), - "aws_lightsail_instance": resourceAwsLightsailInstance(), - "aws_lightsail_key_pair": resourceAwsLightsailKeyPair(), - "aws_lightsail_static_ip": resourceAwsLightsailStaticIp(), - "aws_lightsail_static_ip_attachment": resourceAwsLightsailStaticIpAttachment(), - "aws_lb_cookie_stickiness_policy": resourceAwsLBCookieStickinessPolicy(), - "aws_load_balancer_policy": resourceAwsLoadBalancerPolicy(), - "aws_load_balancer_backend_server_policy": resourceAwsLoadBalancerBackendServerPolicies(), - "aws_load_balancer_listener_policy": resourceAwsLoadBalancerListenerPolicies(), - "aws_lb_ssl_negotiation_policy": resourceAwsLBSSLNegotiationPolicy(), - "aws_macie_member_account_association": resourceAwsMacieMemberAccountAssociation(), - "aws_macie_s3_bucket_association": resourceAwsMacieS3BucketAssociation(), - "aws_main_route_table_association": resourceAwsMainRouteTableAssociation(), - "aws_mq_broker": resourceAwsMqBroker(), - "aws_mq_configuration": resourceAwsMqConfiguration(), - "aws_media_convert_queue": resourceAwsMediaConvertQueue(), - "aws_media_package_channel": resourceAwsMediaPackageChannel(), - "aws_media_store_container": resourceAwsMediaStoreContainer(), - "aws_media_store_container_policy": resourceAwsMediaStoreContainerPolicy(), - "aws_msk_cluster": resourceAwsMskCluster(), - "aws_msk_configuration": resourceAwsMskConfiguration(), - "aws_nat_gateway": resourceAwsNatGateway(), - "aws_network_acl": resourceAwsNetworkAcl(), - "aws_default_network_acl": resourceAwsDefaultNetworkAcl(), - "aws_neptune_cluster": resourceAwsNeptuneCluster(), - "aws_neptune_cluster_instance": resourceAwsNeptuneClusterInstance(), - "aws_neptune_cluster_parameter_group": resourceAwsNeptuneClusterParameterGroup(), - "aws_neptune_cluster_snapshot": resourceAwsNeptuneClusterSnapshot(), - "aws_neptune_event_subscription": resourceAwsNeptuneEventSubscription(), - "aws_neptune_parameter_group": resourceAwsNeptuneParameterGroup(), - "aws_neptune_subnet_group": resourceAwsNeptuneSubnetGroup(), - "aws_network_acl_rule": resourceAwsNetworkAclRule(), - "aws_network_interface": resourceAwsNetworkInterface(), - "aws_network_interface_attachment": resourceAwsNetworkInterfaceAttachment(), - "aws_networkfirewall_firewall": resourceAwsNetworkFirewallFirewall(), - "aws_networkfirewall_firewall_policy": resourceAwsNetworkFirewallFirewallPolicy(), - "aws_networkfirewall_logging_configuration": resourceAwsNetworkFirewallLoggingConfiguration(), - "aws_networkfirewall_rule_group": resourceAwsNetworkFirewallRuleGroup(), - "aws_opsworks_application": resourceAwsOpsworksApplication(), - "aws_opsworks_stack": resourceAwsOpsworksStack(), - "aws_opsworks_java_app_layer": resourceAwsOpsworksJavaAppLayer(), - "aws_opsworks_haproxy_layer": resourceAwsOpsworksHaproxyLayer(), - "aws_opsworks_static_web_layer": resourceAwsOpsworksStaticWebLayer(), - "aws_opsworks_php_app_layer": resourceAwsOpsworksPhpAppLayer(), - "aws_opsworks_rails_app_layer": resourceAwsOpsworksRailsAppLayer(), - "aws_opsworks_nodejs_app_layer": resourceAwsOpsworksNodejsAppLayer(), - "aws_opsworks_memcached_layer": resourceAwsOpsworksMemcachedLayer(), - "aws_opsworks_mysql_layer": resourceAwsOpsworksMysqlLayer(), - "aws_opsworks_ganglia_layer": resourceAwsOpsworksGangliaLayer(), - "aws_opsworks_custom_layer": resourceAwsOpsworksCustomLayer(), - "aws_opsworks_instance": resourceAwsOpsworksInstance(), - "aws_opsworks_user_profile": resourceAwsOpsworksUserProfile(), - "aws_opsworks_permission": resourceAwsOpsworksPermission(), - "aws_opsworks_rds_db_instance": resourceAwsOpsworksRdsDbInstance(), - "aws_organizations_organization": resourceAwsOrganizationsOrganization(), - "aws_organizations_account": resourceAwsOrganizationsAccount(), - "aws_organizations_policy": resourceAwsOrganizationsPolicy(), - "aws_organizations_policy_attachment": resourceAwsOrganizationsPolicyAttachment(), - "aws_organizations_organizational_unit": resourceAwsOrganizationsOrganizationalUnit(), - "aws_placement_group": resourceAwsPlacementGroup(), - "aws_proxy_protocol_policy": resourceAwsProxyProtocolPolicy(), - "aws_qldb_ledger": resourceAwsQLDBLedger(), - "aws_quicksight_group": resourceAwsQuickSightGroup(), - "aws_quicksight_user": resourceAwsQuickSightUser(), - "aws_ram_principal_association": resourceAwsRamPrincipalAssociation(), - "aws_ram_resource_association": resourceAwsRamResourceAssociation(), - "aws_ram_resource_share": resourceAwsRamResourceShare(), - "aws_ram_resource_share_accepter": resourceAwsRamResourceShareAccepter(), - "aws_rds_cluster": resourceAwsRDSCluster(), - "aws_rds_cluster_endpoint": resourceAwsRDSClusterEndpoint(), - "aws_rds_cluster_instance": resourceAwsRDSClusterInstance(), - "aws_rds_cluster_parameter_group": resourceAwsRDSClusterParameterGroup(), - "aws_rds_global_cluster": resourceAwsRDSGlobalCluster(), - "aws_redshift_cluster": resourceAwsRedshiftCluster(), - "aws_redshift_security_group": resourceAwsRedshiftSecurityGroup(), - "aws_redshift_parameter_group": resourceAwsRedshiftParameterGroup(), - "aws_redshift_subnet_group": resourceAwsRedshiftSubnetGroup(), - "aws_redshift_snapshot_copy_grant": resourceAwsRedshiftSnapshotCopyGrant(), - "aws_redshift_snapshot_schedule": resourceAwsRedshiftSnapshotSchedule(), - "aws_redshift_snapshot_schedule_association": resourceAwsRedshiftSnapshotScheduleAssociation(), - "aws_redshift_event_subscription": resourceAwsRedshiftEventSubscription(), - "aws_resourcegroups_group": resourceAwsResourceGroupsGroup(), - "aws_route53_delegation_set": resourceAwsRoute53DelegationSet(), - "aws_route53_query_log": resourceAwsRoute53QueryLog(), - "aws_route53_record": resourceAwsRoute53Record(), - "aws_route53_zone_association": resourceAwsRoute53ZoneAssociation(), - "aws_route53_vpc_association_authorization": resourceAwsRoute53VPCAssociationAuthorization(), - "aws_route53_zone": resourceAwsRoute53Zone(), - "aws_route53_health_check": resourceAwsRoute53HealthCheck(), - "aws_route53_resolver_endpoint": resourceAwsRoute53ResolverEndpoint(), - "aws_route53_resolver_query_log_config": resourceAwsRoute53ResolverQueryLogConfig(), - "aws_route53_resolver_query_log_config_association": resourceAwsRoute53ResolverQueryLogConfigAssociation(), - "aws_route53_resolver_rule_association": resourceAwsRoute53ResolverRuleAssociation(), - "aws_route53_resolver_rule": resourceAwsRoute53ResolverRule(), - "aws_route": resourceAwsRoute(), - "aws_route_table": resourceAwsRouteTable(), - "aws_default_route_table": resourceAwsDefaultRouteTable(), - "aws_route_table_association": resourceAwsRouteTableAssociation(), - "aws_sagemaker_code_repository": resourceAwsSagemakerCodeRepository(), - "aws_sagemaker_model": resourceAwsSagemakerModel(), - "aws_sagemaker_endpoint_configuration": resourceAwsSagemakerEndpointConfiguration(), - "aws_sagemaker_endpoint": resourceAwsSagemakerEndpoint(), - "aws_sagemaker_notebook_instance_lifecycle_configuration": resourceAwsSagemakerNotebookInstanceLifeCycleConfiguration(), - "aws_sagemaker_notebook_instance": resourceAwsSagemakerNotebookInstance(), - "aws_secretsmanager_secret": resourceAwsSecretsManagerSecret(), - "aws_secretsmanager_secret_policy": resourceAwsSecretsManagerSecretPolicy(), - "aws_secretsmanager_secret_version": resourceAwsSecretsManagerSecretVersion(), - "aws_secretsmanager_secret_rotation": resourceAwsSecretsManagerSecretRotation(), - "aws_ses_active_receipt_rule_set": resourceAwsSesActiveReceiptRuleSet(), - "aws_ses_domain_identity": resourceAwsSesDomainIdentity(), - "aws_ses_domain_identity_verification": resourceAwsSesDomainIdentityVerification(), - "aws_ses_domain_dkim": resourceAwsSesDomainDkim(), - "aws_ses_domain_mail_from": resourceAwsSesDomainMailFrom(), - "aws_ses_email_identity": resourceAwsSesEmailIdentity(), - "aws_ses_identity_policy": resourceAwsSesIdentityPolicy(), - "aws_ses_receipt_filter": resourceAwsSesReceiptFilter(), - "aws_ses_receipt_rule": resourceAwsSesReceiptRule(), - "aws_ses_receipt_rule_set": resourceAwsSesReceiptRuleSet(), - "aws_ses_configuration_set": resourceAwsSesConfigurationSet(), - "aws_ses_event_destination": resourceAwsSesEventDestination(), - "aws_ses_identity_notification_topic": resourceAwsSesNotificationTopic(), - "aws_ses_template": resourceAwsSesTemplate(), - "aws_s3_access_point": resourceAwsS3AccessPoint(), - "aws_s3_account_public_access_block": resourceAwsS3AccountPublicAccessBlock(), - "aws_s3_bucket": resourceAwsS3Bucket(), - "aws_s3_bucket_analytics_configuration": resourceAwsS3BucketAnalyticsConfiguration(), - "aws_s3_bucket_policy": resourceAwsS3BucketPolicy(), - "aws_s3_bucket_public_access_block": resourceAwsS3BucketPublicAccessBlock(), - "aws_s3_bucket_object": resourceAwsS3BucketObject(), - "aws_s3_bucket_ownership_controls": resourceAwsS3BucketOwnershipControls(), - "aws_s3_bucket_notification": resourceAwsS3BucketNotification(), - "aws_s3_bucket_metric": resourceAwsS3BucketMetric(), - "aws_s3_bucket_inventory": resourceAwsS3BucketInventory(), - "aws_s3control_bucket": resourceAwsS3ControlBucket(), - "aws_s3control_bucket_policy": resourceAwsS3ControlBucketPolicy(), - "aws_s3control_bucket_lifecycle_configuration": resourceAwsS3ControlBucketLifecycleConfiguration(), - "aws_s3outposts_endpoint": resourceAwsS3OutpostsEndpoint(), - "aws_security_group": resourceAwsSecurityGroup(), - "aws_network_interface_sg_attachment": resourceAwsNetworkInterfaceSGAttachment(), - "aws_default_security_group": resourceAwsDefaultSecurityGroup(), - "aws_security_group_rule": resourceAwsSecurityGroupRule(), - "aws_securityhub_account": resourceAwsSecurityHubAccount(), - "aws_securityhub_action_target": resourceAwsSecurityHubActionTarget(), - "aws_securityhub_member": resourceAwsSecurityHubMember(), - "aws_securityhub_product_subscription": resourceAwsSecurityHubProductSubscription(), - "aws_securityhub_standards_subscription": resourceAwsSecurityHubStandardsSubscription(), - "aws_serverlessrepository_stack": resourceAwsServerlessRepositoryStack(), - "aws_servicecatalog_portfolio": resourceAwsServiceCatalogPortfolio(), - "aws_service_discovery_http_namespace": resourceAwsServiceDiscoveryHttpNamespace(), - "aws_service_discovery_private_dns_namespace": resourceAwsServiceDiscoveryPrivateDnsNamespace(), - "aws_service_discovery_public_dns_namespace": resourceAwsServiceDiscoveryPublicDnsNamespace(), - "aws_service_discovery_service": resourceAwsServiceDiscoveryService(), - "aws_servicequotas_service_quota": resourceAwsServiceQuotasServiceQuota(), - "aws_shield_protection": resourceAwsShieldProtection(), - "aws_simpledb_domain": resourceAwsSimpleDBDomain(), - "aws_ssm_activation": resourceAwsSsmActivation(), - "aws_ssm_association": resourceAwsSsmAssociation(), - "aws_ssm_document": resourceAwsSsmDocument(), - "aws_ssm_maintenance_window": resourceAwsSsmMaintenanceWindow(), - "aws_ssm_maintenance_window_target": resourceAwsSsmMaintenanceWindowTarget(), - "aws_ssm_maintenance_window_task": resourceAwsSsmMaintenanceWindowTask(), - "aws_ssm_patch_baseline": resourceAwsSsmPatchBaseline(), - "aws_ssm_patch_group": resourceAwsSsmPatchGroup(), - "aws_ssm_parameter": resourceAwsSsmParameter(), - "aws_ssm_resource_data_sync": resourceAwsSsmResourceDataSync(), - "aws_storagegateway_cache": resourceAwsStorageGatewayCache(), - "aws_storagegateway_cached_iscsi_volume": resourceAwsStorageGatewayCachedIscsiVolume(), - "aws_storagegateway_gateway": resourceAwsStorageGatewayGateway(), - "aws_storagegateway_nfs_file_share": resourceAwsStorageGatewayNfsFileShare(), - "aws_storagegateway_smb_file_share": resourceAwsStorageGatewaySmbFileShare(), - "aws_storagegateway_stored_iscsi_volume": resourceAwsStorageGatewayStoredIscsiVolume(), - "aws_storagegateway_tape_pool": resourceAwsStorageGatewayTapePool(), - "aws_storagegateway_upload_buffer": resourceAwsStorageGatewayUploadBuffer(), - "aws_storagegateway_working_storage": resourceAwsStorageGatewayWorkingStorage(), - "aws_spot_datafeed_subscription": resourceAwsSpotDataFeedSubscription(), - "aws_spot_instance_request": resourceAwsSpotInstanceRequest(), - "aws_spot_fleet_request": resourceAwsSpotFleetRequest(), - "aws_sqs_queue": resourceAwsSqsQueue(), - "aws_sqs_queue_policy": resourceAwsSqsQueuePolicy(), - "aws_snapshot_create_volume_permission": resourceAwsSnapshotCreateVolumePermission(), - "aws_sns_platform_application": resourceAwsSnsPlatformApplication(), - "aws_sns_sms_preferences": resourceAwsSnsSmsPreferences(), - "aws_sns_topic": resourceAwsSnsTopic(), - "aws_sns_topic_policy": resourceAwsSnsTopicPolicy(), - "aws_sns_topic_subscription": resourceAwsSnsTopicSubscription(), - "aws_sfn_activity": resourceAwsSfnActivity(), - "aws_sfn_state_machine": resourceAwsSfnStateMachine(), - "aws_default_subnet": resourceAwsDefaultSubnet(), - "aws_subnet": resourceAwsSubnet(), - "aws_swf_domain": resourceAwsSwfDomain(), - "aws_transfer_server": resourceAwsTransferServer(), - "aws_transfer_ssh_key": resourceAwsTransferSshKey(), - "aws_transfer_user": resourceAwsTransferUser(), - "aws_volume_attachment": resourceAwsVolumeAttachment(), - "aws_vpc_dhcp_options_association": resourceAwsVpcDhcpOptionsAssociation(), - "aws_default_vpc_dhcp_options": resourceAwsDefaultVpcDhcpOptions(), - "aws_vpc_dhcp_options": resourceAwsVpcDhcpOptions(), - "aws_vpc_peering_connection": resourceAwsVpcPeeringConnection(), - "aws_vpc_peering_connection_accepter": resourceAwsVpcPeeringConnectionAccepter(), - "aws_vpc_peering_connection_options": resourceAwsVpcPeeringConnectionOptions(), - "aws_default_vpc": resourceAwsDefaultVpc(), - "aws_vpc": resourceAwsVpc(), - "aws_vpc_endpoint": resourceAwsVpcEndpoint(), - "aws_vpc_endpoint_connection_notification": resourceAwsVpcEndpointConnectionNotification(), - "aws_vpc_endpoint_route_table_association": resourceAwsVpcEndpointRouteTableAssociation(), - "aws_vpc_endpoint_subnet_association": resourceAwsVpcEndpointSubnetAssociation(), - "aws_vpc_endpoint_service": resourceAwsVpcEndpointService(), - "aws_vpc_endpoint_service_allowed_principal": resourceAwsVpcEndpointServiceAllowedPrincipal(), - "aws_vpc_ipv4_cidr_block_association": resourceAwsVpcIpv4CidrBlockAssociation(), - "aws_vpn_connection": resourceAwsVpnConnection(), - "aws_vpn_connection_route": resourceAwsVpnConnectionRoute(), - "aws_vpn_gateway": resourceAwsVpnGateway(), - "aws_vpn_gateway_attachment": resourceAwsVpnGatewayAttachment(), - "aws_vpn_gateway_route_propagation": resourceAwsVpnGatewayRoutePropagation(), - "aws_waf_byte_match_set": resourceAwsWafByteMatchSet(), - "aws_waf_ipset": resourceAwsWafIPSet(), - "aws_waf_rate_based_rule": resourceAwsWafRateBasedRule(), - "aws_waf_regex_match_set": resourceAwsWafRegexMatchSet(), - "aws_waf_regex_pattern_set": resourceAwsWafRegexPatternSet(), - "aws_waf_rule": resourceAwsWafRule(), - "aws_waf_rule_group": resourceAwsWafRuleGroup(), - "aws_waf_size_constraint_set": resourceAwsWafSizeConstraintSet(), - "aws_waf_web_acl": resourceAwsWafWebAcl(), - "aws_waf_xss_match_set": resourceAwsWafXssMatchSet(), - "aws_waf_sql_injection_match_set": resourceAwsWafSqlInjectionMatchSet(), - "aws_waf_geo_match_set": resourceAwsWafGeoMatchSet(), - "aws_wafregional_byte_match_set": resourceAwsWafRegionalByteMatchSet(), - "aws_wafregional_geo_match_set": resourceAwsWafRegionalGeoMatchSet(), - "aws_wafregional_ipset": resourceAwsWafRegionalIPSet(), - "aws_wafregional_rate_based_rule": resourceAwsWafRegionalRateBasedRule(), - "aws_wafregional_regex_match_set": resourceAwsWafRegionalRegexMatchSet(), - "aws_wafregional_regex_pattern_set": resourceAwsWafRegionalRegexPatternSet(), - "aws_wafregional_rule": resourceAwsWafRegionalRule(), - "aws_wafregional_rule_group": resourceAwsWafRegionalRuleGroup(), - "aws_wafregional_size_constraint_set": resourceAwsWafRegionalSizeConstraintSet(), - "aws_wafregional_sql_injection_match_set": resourceAwsWafRegionalSqlInjectionMatchSet(), - "aws_wafregional_xss_match_set": resourceAwsWafRegionalXssMatchSet(), - "aws_wafregional_web_acl": resourceAwsWafRegionalWebAcl(), - "aws_wafregional_web_acl_association": resourceAwsWafRegionalWebAclAssociation(), - "aws_wafv2_ip_set": resourceAwsWafv2IPSet(), - "aws_wafv2_regex_pattern_set": resourceAwsWafv2RegexPatternSet(), - "aws_wafv2_rule_group": resourceAwsWafv2RuleGroup(), - "aws_wafv2_web_acl": resourceAwsWafv2WebACL(), - "aws_wafv2_web_acl_association": resourceAwsWafv2WebACLAssociation(), - "aws_wafv2_web_acl_logging_configuration": resourceAwsWafv2WebACLLoggingConfiguration(), - "aws_worklink_fleet": resourceAwsWorkLinkFleet(), - "aws_worklink_website_certificate_authority_association": resourceAwsWorkLinkWebsiteCertificateAuthorityAssociation(), - "aws_workspaces_directory": resourceAwsWorkspacesDirectory(), - "aws_workspaces_workspace": resourceAwsWorkspacesWorkspace(), - "aws_batch_compute_environment": resourceAwsBatchComputeEnvironment(), - "aws_batch_job_definition": resourceAwsBatchJobDefinition(), - "aws_batch_job_queue": resourceAwsBatchJobQueue(), - "aws_pinpoint_app": resourceAwsPinpointApp(), - "aws_pinpoint_adm_channel": resourceAwsPinpointADMChannel(), - "aws_pinpoint_apns_channel": resourceAwsPinpointAPNSChannel(), - "aws_pinpoint_apns_sandbox_channel": resourceAwsPinpointAPNSSandboxChannel(), - "aws_pinpoint_apns_voip_channel": resourceAwsPinpointAPNSVoipChannel(), - "aws_pinpoint_apns_voip_sandbox_channel": resourceAwsPinpointAPNSVoipSandboxChannel(), - "aws_pinpoint_baidu_channel": resourceAwsPinpointBaiduChannel(), - "aws_pinpoint_email_channel": resourceAwsPinpointEmailChannel(), - "aws_pinpoint_event_stream": resourceAwsPinpointEventStream(), - "aws_pinpoint_gcm_channel": resourceAwsPinpointGCMChannel(), - "aws_pinpoint_sms_channel": resourceAwsPinpointSMSChannel(), - "aws_xray_encryption_config": resourceAwsXrayEncryptionConfig(), - "aws_xray_group": resourceAwsXrayGroup(), - "aws_xray_sampling_rule": resourceAwsXraySamplingRule(), - "aws_workspaces_ip_group": resourceAwsWorkspacesIpGroup(), + "aws_accessanalyzer_analyzer": resourceAwsAccessAnalyzerAnalyzer(), + "aws_acm_certificate": resourceAwsAcmCertificate(), + "aws_acm_certificate_validation": resourceAwsAcmCertificateValidation(), + "aws_acmpca_certificate_authority": resourceAwsAcmpcaCertificateAuthority(), + "aws_ami": resourceAwsAmi(), + "aws_ami_copy": resourceAwsAmiCopy(), + "aws_ami_from_instance": resourceAwsAmiFromInstance(), + "aws_ami_launch_permission": resourceAwsAmiLaunchPermission(), + "aws_api_gateway_account": resourceAwsApiGatewayAccount(), + "aws_api_gateway_api_key": resourceAwsApiGatewayApiKey(), + "aws_api_gateway_authorizer": resourceAwsApiGatewayAuthorizer(), + "aws_api_gateway_base_path_mapping": resourceAwsApiGatewayBasePathMapping(), + "aws_api_gateway_client_certificate": resourceAwsApiGatewayClientCertificate(), + "aws_api_gateway_deployment": resourceAwsApiGatewayDeployment(), + "aws_api_gateway_documentation_part": resourceAwsApiGatewayDocumentationPart(), + "aws_api_gateway_documentation_version": resourceAwsApiGatewayDocumentationVersion(), + "aws_api_gateway_domain_name": resourceAwsApiGatewayDomainName(), + "aws_api_gateway_gateway_response": resourceAwsApiGatewayGatewayResponse(), + "aws_api_gateway_integration": resourceAwsApiGatewayIntegration(), + "aws_api_gateway_integration_response": resourceAwsApiGatewayIntegrationResponse(), + "aws_api_gateway_method": resourceAwsApiGatewayMethod(), + "aws_api_gateway_method_response": resourceAwsApiGatewayMethodResponse(), + "aws_api_gateway_method_settings": resourceAwsApiGatewayMethodSettings(), + "aws_api_gateway_model": resourceAwsApiGatewayModel(), + "aws_api_gateway_request_validator": resourceAwsApiGatewayRequestValidator(), + "aws_api_gateway_resource": resourceAwsApiGatewayResource(), + "aws_api_gateway_rest_api": resourceAwsApiGatewayRestApi(), + "aws_api_gateway_rest_api_policy": resourceAwsApiGatewayRestApiPolicy(), + "aws_api_gateway_stage": resourceAwsApiGatewayStage(), + "aws_api_gateway_usage_plan": resourceAwsApiGatewayUsagePlan(), + "aws_api_gateway_usage_plan_key": resourceAwsApiGatewayUsagePlanKey(), + "aws_api_gateway_vpc_link": resourceAwsApiGatewayVpcLink(), + "aws_apigatewayv2_api": resourceAwsApiGatewayV2Api(), + "aws_apigatewayv2_api_mapping": resourceAwsApiGatewayV2ApiMapping(), + "aws_apigatewayv2_authorizer": resourceAwsApiGatewayV2Authorizer(), + "aws_apigatewayv2_deployment": resourceAwsApiGatewayV2Deployment(), + "aws_apigatewayv2_domain_name": resourceAwsApiGatewayV2DomainName(), + "aws_apigatewayv2_integration": resourceAwsApiGatewayV2Integration(), + "aws_apigatewayv2_integration_response": resourceAwsApiGatewayV2IntegrationResponse(), + "aws_apigatewayv2_model": resourceAwsApiGatewayV2Model(), + "aws_apigatewayv2_route": resourceAwsApiGatewayV2Route(), + "aws_apigatewayv2_route_response": resourceAwsApiGatewayV2RouteResponse(), + "aws_apigatewayv2_stage": resourceAwsApiGatewayV2Stage(), + "aws_apigatewayv2_vpc_link": resourceAwsApiGatewayV2VpcLink(), + "aws_app_cookie_stickiness_policy": resourceAwsAppCookieStickinessPolicy(), + "aws_appautoscaling_target": resourceAwsAppautoscalingTarget(), + "aws_appautoscaling_policy": resourceAwsAppautoscalingPolicy(), + "aws_appautoscaling_scheduled_action": resourceAwsAppautoscalingScheduledAction(), + "aws_appmesh_gateway_route": resourceAwsAppmeshGatewayRoute(), + "aws_appmesh_mesh": resourceAwsAppmeshMesh(), + "aws_appmesh_route": resourceAwsAppmeshRoute(), + "aws_appmesh_virtual_gateway": resourceAwsAppmeshVirtualGateway(), + "aws_appmesh_virtual_node": resourceAwsAppmeshVirtualNode(), + "aws_appmesh_virtual_router": resourceAwsAppmeshVirtualRouter(), + "aws_appmesh_virtual_service": resourceAwsAppmeshVirtualService(), + "aws_appsync_api_key": resourceAwsAppsyncApiKey(), + "aws_appsync_datasource": resourceAwsAppsyncDatasource(), + "aws_appsync_function": resourceAwsAppsyncFunction(), + "aws_appsync_graphql_api": resourceAwsAppsyncGraphqlApi(), + "aws_appsync_resolver": resourceAwsAppsyncResolver(), + "aws_athena_database": resourceAwsAthenaDatabase(), + "aws_athena_named_query": resourceAwsAthenaNamedQuery(), + "aws_athena_workgroup": resourceAwsAthenaWorkgroup(), + "aws_autoscaling_attachment": resourceAwsAutoscalingAttachment(), + "aws_autoscaling_group": resourceAwsAutoscalingGroup(), + "aws_autoscaling_lifecycle_hook": resourceAwsAutoscalingLifecycleHook(), + "aws_autoscaling_notification": resourceAwsAutoscalingNotification(), + "aws_autoscaling_policy": resourceAwsAutoscalingPolicy(), + "aws_autoscaling_schedule": resourceAwsAutoscalingSchedule(), + "aws_autoscalingplans_scaling_plan": resourceAwsAutoScalingPlansScalingPlan(), + "aws_backup_plan": resourceAwsBackupPlan(), + "aws_backup_selection": resourceAwsBackupSelection(), + "aws_backup_vault": resourceAwsBackupVault(), + "aws_backup_vault_notifications": resourceAwsBackupVaultNotifications(), + "aws_backup_vault_policy": resourceAwsBackupVaultPolicy(), + "aws_budgets_budget": resourceAwsBudgetsBudget(), + "aws_cloud9_environment_ec2": resourceAwsCloud9EnvironmentEc2(), + "aws_cloudformation_stack": resourceAwsCloudFormationStack(), + "aws_cloudformation_stack_set": resourceAwsCloudFormationStackSet(), + "aws_cloudformation_stack_set_instance": resourceAwsCloudFormationStackSetInstance(), + "aws_cloudfront_distribution": resourceAwsCloudFrontDistribution(), + "aws_cloudfront_origin_access_identity": resourceAwsCloudFrontOriginAccessIdentity(), + "aws_cloudfront_public_key": resourceAwsCloudFrontPublicKey(), + "aws_cloudtrail": resourceAwsCloudTrail(), + "aws_cloudwatch_event_bus": resourceAwsCloudWatchEventBus(), + "aws_cloudwatch_event_permission": resourceAwsCloudWatchEventPermission(), + "aws_cloudwatch_event_rule": resourceAwsCloudWatchEventRule(), + "aws_cloudwatch_event_target": resourceAwsCloudWatchEventTarget(), + "aws_cloudwatch_log_destination": resourceAwsCloudWatchLogDestination(), + "aws_cloudwatch_log_destination_policy": resourceAwsCloudWatchLogDestinationPolicy(), + "aws_cloudwatch_log_group": resourceAwsCloudWatchLogGroup(), + "aws_cloudwatch_log_metric_filter": resourceAwsCloudWatchLogMetricFilter(), + "aws_cloudwatch_log_resource_policy": resourceAwsCloudWatchLogResourcePolicy(), + "aws_cloudwatch_log_stream": resourceAwsCloudWatchLogStream(), + "aws_cloudwatch_log_subscription_filter": resourceAwsCloudwatchLogSubscriptionFilter(), + "aws_config_aggregate_authorization": resourceAwsConfigAggregateAuthorization(), + "aws_config_config_rule": resourceAwsConfigConfigRule(), + "aws_config_configuration_aggregator": resourceAwsConfigConfigurationAggregator(), + "aws_config_configuration_recorder": resourceAwsConfigConfigurationRecorder(), + "aws_config_configuration_recorder_status": resourceAwsConfigConfigurationRecorderStatus(), + "aws_config_delivery_channel": resourceAwsConfigDeliveryChannel(), + "aws_config_organization_custom_rule": resourceAwsConfigOrganizationCustomRule(), + "aws_config_organization_managed_rule": resourceAwsConfigOrganizationManagedRule(), + "aws_config_remediation_configuration": resourceAwsConfigRemediationConfiguration(), + "aws_cognito_identity_pool": resourceAwsCognitoIdentityPool(), + "aws_cognito_identity_pool_roles_attachment": resourceAwsCognitoIdentityPoolRolesAttachment(), + "aws_cognito_identity_provider": resourceAwsCognitoIdentityProvider(), + "aws_cognito_user_group": resourceAwsCognitoUserGroup(), + "aws_cognito_user_pool": resourceAwsCognitoUserPool(), + "aws_cognito_user_pool_client": resourceAwsCognitoUserPoolClient(), + "aws_cognito_user_pool_domain": resourceAwsCognitoUserPoolDomain(), + "aws_cloudhsm_v2_cluster": resourceAwsCloudHsmV2Cluster(), + "aws_cloudhsm_v2_hsm": resourceAwsCloudHsmV2Hsm(), + "aws_cognito_resource_server": resourceAwsCognitoResourceServer(), + "aws_cloudwatch_metric_alarm": resourceAwsCloudWatchMetricAlarm(), + "aws_cloudwatch_dashboard": resourceAwsCloudWatchDashboard(), + "aws_codedeploy_app": resourceAwsCodeDeployApp(), + "aws_codedeploy_deployment_config": resourceAwsCodeDeployDeploymentConfig(), + "aws_codedeploy_deployment_group": resourceAwsCodeDeployDeploymentGroup(), + "aws_codecommit_repository": resourceAwsCodeCommitRepository(), + "aws_codecommit_trigger": resourceAwsCodeCommitTrigger(), + "aws_codeartifact_domain": resourceAwsCodeArtifactDomain(), + "aws_codeartifact_domain_permissions_policy": resourceAwsCodeArtifactDomainPermissionsPolicy(), + "aws_codeartifact_repository": resourceAwsCodeArtifactRepository(), + "aws_codeartifact_repository_permissions_policy": resourceAwsCodeArtifactRepositoryPermissionsPolicy(), + "aws_codebuild_project": resourceAwsCodeBuildProject(), + "aws_codebuild_report_group": resourceAwsCodeBuildReportGroup(), + "aws_codebuild_source_credential": resourceAwsCodeBuildSourceCredential(), + "aws_codebuild_webhook": resourceAwsCodeBuildWebhook(), + "aws_codepipeline": resourceAwsCodePipeline(), + "aws_codepipeline_webhook": resourceAwsCodePipelineWebhook(), + "aws_codestarnotifications_notification_rule": resourceAwsCodeStarNotificationsNotificationRule(), + "aws_cur_report_definition": resourceAwsCurReportDefinition(), + "aws_customer_gateway": resourceAwsCustomerGateway(), + "aws_datapipeline_pipeline": resourceAwsDataPipelinePipeline(), + "aws_datasync_agent": resourceAwsDataSyncAgent(), + "aws_datasync_location_efs": resourceAwsDataSyncLocationEfs(), + "aws_datasync_location_fsx_windows_file_system": resourceAwsDataSyncLocationFsxWindowsFileSystem(), + "aws_datasync_location_nfs": resourceAwsDataSyncLocationNfs(), + "aws_datasync_location_s3": resourceAwsDataSyncLocationS3(), + "aws_datasync_location_smb": resourceAwsDataSyncLocationSmb(), + "aws_datasync_task": resourceAwsDataSyncTask(), + "aws_dax_cluster": resourceAwsDaxCluster(), + "aws_dax_parameter_group": resourceAwsDaxParameterGroup(), + "aws_dax_subnet_group": resourceAwsDaxSubnetGroup(), + "aws_db_cluster_snapshot": resourceAwsDbClusterSnapshot(), + "aws_db_event_subscription": resourceAwsDbEventSubscription(), + "aws_db_instance": resourceAwsDbInstance(), + "aws_db_instance_role_association": resourceAwsDbInstanceRoleAssociation(), + "aws_db_option_group": resourceAwsDbOptionGroup(), + "aws_db_parameter_group": resourceAwsDbParameterGroup(), + "aws_db_proxy": resourceAwsDbProxy(), + "aws_db_proxy_default_target_group": resourceAwsDbProxyDefaultTargetGroup(), + "aws_db_proxy_target": resourceAwsDbProxyTarget(), + "aws_db_security_group": resourceAwsDbSecurityGroup(), + "aws_db_snapshot": resourceAwsDbSnapshot(), + "aws_db_subnet_group": resourceAwsDbSubnetGroup(), + "aws_devicefarm_project": resourceAwsDevicefarmProject(), + "aws_directory_service_directory": resourceAwsDirectoryServiceDirectory(), + "aws_directory_service_conditional_forwarder": resourceAwsDirectoryServiceConditionalForwarder(), + "aws_directory_service_log_subscription": resourceAwsDirectoryServiceLogSubscription(), + "aws_dlm_lifecycle_policy": resourceAwsDlmLifecyclePolicy(), + "aws_dms_certificate": resourceAwsDmsCertificate(), + "aws_dms_endpoint": resourceAwsDmsEndpoint(), + "aws_dms_event_subscription": resourceAwsDmsEventSubscription(), + "aws_dms_replication_instance": resourceAwsDmsReplicationInstance(), + "aws_dms_replication_subnet_group": resourceAwsDmsReplicationSubnetGroup(), + "aws_dms_replication_task": resourceAwsDmsReplicationTask(), + "aws_docdb_cluster": resourceAwsDocDBCluster(), + "aws_docdb_cluster_instance": resourceAwsDocDBClusterInstance(), + "aws_docdb_cluster_parameter_group": resourceAwsDocDBClusterParameterGroup(), + "aws_docdb_cluster_snapshot": resourceAwsDocDBClusterSnapshot(), + "aws_docdb_subnet_group": resourceAwsDocDBSubnetGroup(), + "aws_dx_bgp_peer": resourceAwsDxBgpPeer(), + "aws_dx_connection": resourceAwsDxConnection(), + "aws_dx_connection_association": resourceAwsDxConnectionAssociation(), + "aws_dx_gateway": resourceAwsDxGateway(), + "aws_dx_gateway_association": resourceAwsDxGatewayAssociation(), + "aws_dx_gateway_association_proposal": resourceAwsDxGatewayAssociationProposal(), + "aws_dx_hosted_private_virtual_interface": resourceAwsDxHostedPrivateVirtualInterface(), + "aws_dx_hosted_private_virtual_interface_accepter": resourceAwsDxHostedPrivateVirtualInterfaceAccepter(), + "aws_dx_hosted_public_virtual_interface": resourceAwsDxHostedPublicVirtualInterface(), + "aws_dx_hosted_public_virtual_interface_accepter": resourceAwsDxHostedPublicVirtualInterfaceAccepter(), + "aws_dx_hosted_transit_virtual_interface": resourceAwsDxHostedTransitVirtualInterface(), + "aws_dx_hosted_transit_virtual_interface_accepter": resourceAwsDxHostedTransitVirtualInterfaceAccepter(), + "aws_dx_lag": resourceAwsDxLag(), + "aws_dx_private_virtual_interface": resourceAwsDxPrivateVirtualInterface(), + "aws_dx_public_virtual_interface": resourceAwsDxPublicVirtualInterface(), + "aws_dx_transit_virtual_interface": resourceAwsDxTransitVirtualInterface(), + "aws_dynamodb_table": resourceAwsDynamoDbTable(), + "aws_dynamodb_table_item": resourceAwsDynamoDbTableItem(), + "aws_dynamodb_global_table": resourceAwsDynamoDbGlobalTable(), + "aws_ebs_default_kms_key": resourceAwsEbsDefaultKmsKey(), + "aws_ebs_encryption_by_default": resourceAwsEbsEncryptionByDefault(), + "aws_ebs_snapshot": resourceAwsEbsSnapshot(), + "aws_ebs_snapshot_copy": resourceAwsEbsSnapshotCopy(), + "aws_ebs_volume": resourceAwsEbsVolume(), + "aws_ec2_availability_zone_group": resourceAwsEc2AvailabilityZoneGroup(), + "aws_ec2_capacity_reservation": resourceAwsEc2CapacityReservation(), + "aws_ec2_client_vpn_authorization_rule": resourceAwsEc2ClientVpnAuthorizationRule(), + "aws_ec2_client_vpn_endpoint": resourceAwsEc2ClientVpnEndpoint(), + "aws_ec2_client_vpn_network_association": resourceAwsEc2ClientVpnNetworkAssociation(), + "aws_ec2_client_vpn_route": resourceAwsEc2ClientVpnRoute(), + "aws_ec2_fleet": resourceAwsEc2Fleet(), + "aws_ec2_local_gateway_route": resourceAwsEc2LocalGatewayRoute(), + "aws_ec2_local_gateway_route_table_vpc_association": resourceAwsEc2LocalGatewayRouteTableVpcAssociation(), + "aws_ec2_tag": resourceAwsEc2Tag(), + "aws_ec2_traffic_mirror_filter": resourceAwsEc2TrafficMirrorFilter(), + "aws_ec2_traffic_mirror_filter_rule": resourceAwsEc2TrafficMirrorFilterRule(), + "aws_ec2_traffic_mirror_target": resourceAwsEc2TrafficMirrorTarget(), + "aws_ec2_traffic_mirror_session": resourceAwsEc2TrafficMirrorSession(), + "aws_ec2_transit_gateway": resourceAwsEc2TransitGateway(), + "aws_ec2_transit_gateway_peering_attachment": resourceAwsEc2TransitGatewayPeeringAttachment(), + "aws_ec2_transit_gateway_peering_attachment_accepter": resourceAwsEc2TransitGatewayPeeringAttachmentAccepter(), + "aws_ec2_transit_gateway_route": resourceAwsEc2TransitGatewayRoute(), + "aws_ec2_transit_gateway_route_table": resourceAwsEc2TransitGatewayRouteTable(), + "aws_ec2_transit_gateway_route_table_association": resourceAwsEc2TransitGatewayRouteTableAssociation(), + "aws_ec2_transit_gateway_route_table_propagation": resourceAwsEc2TransitGatewayRouteTablePropagation(), + "aws_ec2_transit_gateway_vpc_attachment": resourceAwsEc2TransitGatewayVpcAttachment(), + "aws_ec2_transit_gateway_vpc_attachment_accepter": resourceAwsEc2TransitGatewayVpcAttachmentAccepter(), + "aws_ecr_lifecycle_policy": resourceAwsEcrLifecyclePolicy(), + "aws_ecr_repository": resourceAwsEcrRepository(), + "aws_ecr_repository_policy": resourceAwsEcrRepositoryPolicy(), + "aws_ecs_capacity_provider": resourceAwsEcsCapacityProvider(), + "aws_ecs_cluster": resourceAwsEcsCluster(), + "aws_ecs_service": resourceAwsEcsService(), + "aws_ecs_task_definition": resourceAwsEcsTaskDefinition(), + "aws_efs_access_point": resourceAwsEfsAccessPoint(), + "aws_efs_file_system": resourceAwsEfsFileSystem(), + "aws_efs_file_system_policy": resourceAwsEfsFileSystemPolicy(), + "aws_efs_mount_target": resourceAwsEfsMountTarget(), + "aws_egress_only_internet_gateway": resourceAwsEgressOnlyInternetGateway(), + "aws_eip": resourceAwsEip(), + "aws_eip_association": resourceAwsEipAssociation(), + "aws_eks_cluster": resourceAwsEksCluster(), + "aws_eks_fargate_profile": resourceAwsEksFargateProfile(), + "aws_eks_node_group": resourceAwsEksNodeGroup(), + "aws_elasticache_cluster": resourceAwsElasticacheCluster(), + "aws_elasticache_parameter_group": resourceAwsElasticacheParameterGroup(), + "aws_elasticache_replication_group": resourceAwsElasticacheReplicationGroup(), + "aws_elasticache_security_group": resourceAwsElasticacheSecurityGroup(), + "aws_elasticache_subnet_group": resourceAwsElasticacheSubnetGroup(), + "aws_elastic_beanstalk_application": resourceAwsElasticBeanstalkApplication(), + "aws_elastic_beanstalk_application_version": resourceAwsElasticBeanstalkApplicationVersion(), + "aws_elastic_beanstalk_configuration_template": resourceAwsElasticBeanstalkConfigurationTemplate(), + "aws_elastic_beanstalk_environment": resourceAwsElasticBeanstalkEnvironment(), + "aws_elasticsearch_domain": resourceAwsElasticSearchDomain(), + "aws_elasticsearch_domain_policy": resourceAwsElasticSearchDomainPolicy(), + "aws_elastictranscoder_pipeline": resourceAwsElasticTranscoderPipeline(), + "aws_elastictranscoder_preset": resourceAwsElasticTranscoderPreset(), + "aws_elb": resourceAwsElb(), + "aws_elb_attachment": resourceAwsElbAttachment(), + "aws_emr_cluster": resourceAwsEMRCluster(), + "aws_emr_instance_group": resourceAwsEMRInstanceGroup(), + "aws_emr_instance_fleet": resourceAwsEMRInstanceFleet(), + "aws_emr_managed_scaling_policy": resourceAwsEMRManagedScalingPolicy(), + "aws_emr_security_configuration": resourceAwsEMRSecurityConfiguration(), + "aws_flow_log": resourceAwsFlowLog(), + "aws_fsx_lustre_file_system": resourceAwsFsxLustreFileSystem(), + "aws_fsx_windows_file_system": resourceAwsFsxWindowsFileSystem(), + "aws_fms_admin_account": resourceAwsFmsAdminAccount(), + "aws_gamelift_alias": resourceAwsGameliftAlias(), + "aws_gamelift_build": resourceAwsGameliftBuild(), + "aws_gamelift_fleet": resourceAwsGameliftFleet(), + "aws_gamelift_game_session_queue": resourceAwsGameliftGameSessionQueue(), + "aws_glacier_vault": resourceAwsGlacierVault(), + "aws_glacier_vault_lock": resourceAwsGlacierVaultLock(), + "aws_globalaccelerator_accelerator": resourceAwsGlobalAcceleratorAccelerator(), + "aws_globalaccelerator_endpoint_group": resourceAwsGlobalAcceleratorEndpointGroup(), + "aws_globalaccelerator_listener": resourceAwsGlobalAcceleratorListener(), + "aws_glue_catalog_database": resourceAwsGlueCatalogDatabase(), + "aws_glue_catalog_table": resourceAwsGlueCatalogTable(), + "aws_glue_classifier": resourceAwsGlueClassifier(), + "aws_glue_connection": resourceAwsGlueConnection(), + "aws_glue_dev_endpoint": resourceAwsGlueDevEndpoint(), + "aws_glue_crawler": resourceAwsGlueCrawler(), + "aws_glue_data_catalog_encryption_settings": resourceAwsGlueDataCatalogEncryptionSettings(), + "aws_glue_job": resourceAwsGlueJob(), + "aws_glue_ml_transform": resourceAwsGlueMLTransform(), + "aws_glue_partition": resourceAwsGluePartition(), + "aws_glue_security_configuration": resourceAwsGlueSecurityConfiguration(), + "aws_glue_trigger": resourceAwsGlueTrigger(), + "aws_glue_user_defined_function": resourceAwsGlueUserDefinedFunction(), + "aws_glue_workflow": resourceAwsGlueWorkflow(), + "aws_glue_resource_policy": resourceAwsGlueResourcePolicy(), + "aws_guardduty_detector": resourceAwsGuardDutyDetector(), + "aws_guardduty_filter": resourceAwsGuardDutyFilter(), + "aws_guardduty_invite_accepter": resourceAwsGuardDutyInviteAccepter(), + "aws_guardduty_ipset": resourceAwsGuardDutyIpset(), + "aws_guardduty_member": resourceAwsGuardDutyMember(), + "aws_guardduty_organization_admin_account": resourceAwsGuardDutyOrganizationAdminAccount(), + "aws_guardduty_organization_configuration": resourceAwsGuardDutyOrganizationConfiguration(), + "aws_guardduty_publishing_destination": resourceAwsGuardDutyPublishingDestination(), + "aws_guardduty_threatintelset": resourceAwsGuardDutyThreatintelset(), + "aws_iam_access_key": resourceAwsIamAccessKey(), + "aws_iam_account_alias": resourceAwsIamAccountAlias(), + "aws_iam_account_password_policy": resourceAwsIamAccountPasswordPolicy(), + "aws_iam_group_policy": resourceAwsIamGroupPolicy(), + "aws_iam_group": resourceAwsIamGroup(), + "aws_iam_group_membership": resourceAwsIamGroupMembership(), + "aws_iam_group_policy_attachment": resourceAwsIamGroupPolicyAttachment(), + "aws_iam_instance_profile": resourceAwsIamInstanceProfile(), + "aws_iam_openid_connect_provider": resourceAwsIamOpenIDConnectProvider(), + "aws_iam_policy": resourceAwsIamPolicy(), + "aws_iam_policy_attachment": resourceAwsIamPolicyAttachment(), + "aws_iam_role_policy_attachment": resourceAwsIamRolePolicyAttachment(), + "aws_iam_role_policy": resourceAwsIamRolePolicy(), + "aws_iam_role": resourceAwsIamRole(), + "aws_iam_saml_provider": resourceAwsIamSamlProvider(), + "aws_iam_server_certificate": resourceAwsIAMServerCertificate(), + "aws_iam_service_linked_role": resourceAwsIamServiceLinkedRole(), + "aws_iam_user_group_membership": resourceAwsIamUserGroupMembership(), + "aws_iam_user_policy_attachment": resourceAwsIamUserPolicyAttachment(), + "aws_iam_user_policy": resourceAwsIamUserPolicy(), + "aws_iam_user_ssh_key": resourceAwsIamUserSshKey(), + "aws_iam_user": resourceAwsIamUser(), + "aws_iam_user_login_profile": resourceAwsIamUserLoginProfile(), + "aws_imagebuilder_component": resourceAwsImageBuilderComponent(), + "aws_imagebuilder_distribution_configuration": resourceAwsImageBuilderDistributionConfiguration(), + "aws_imagebuilder_infrastructure_configuration": resourceAwsImageBuilderInfrastructureConfiguration(), + "aws_inspector_assessment_target": resourceAWSInspectorAssessmentTarget(), + "aws_inspector_assessment_template": resourceAWSInspectorAssessmentTemplate(), + "aws_inspector_resource_group": resourceAWSInspectorResourceGroup(), + "aws_instance": resourceAwsInstance(), + "aws_internet_gateway": resourceAwsInternetGateway(), + "aws_iot_certificate": resourceAwsIotCertificate(), + "aws_iot_policy": resourceAwsIotPolicy(), + "aws_iot_policy_attachment": resourceAwsIotPolicyAttachment(), + "aws_iot_thing": resourceAwsIotThing(), + "aws_iot_thing_principal_attachment": resourceAwsIotThingPrincipalAttachment(), + "aws_iot_thing_type": resourceAwsIotThingType(), + "aws_iot_topic_rule": resourceAwsIotTopicRule(), + "aws_iot_role_alias": resourceAwsIotRoleAlias(), + "aws_key_pair": resourceAwsKeyPair(), + "aws_kinesis_analytics_application": resourceAwsKinesisAnalyticsApplication(), + "aws_kinesisanalyticsv2_application": resourceAwsKinesisAnalyticsV2Application(), + "aws_kinesis_firehose_delivery_stream": resourceAwsKinesisFirehoseDeliveryStream(), + "aws_kinesis_stream": resourceAwsKinesisStream(), + "aws_kinesis_video_stream": resourceAwsKinesisVideoStream(), + "aws_kms_alias": resourceAwsKmsAlias(), + "aws_kms_external_key": resourceAwsKmsExternalKey(), + "aws_kms_grant": resourceAwsKmsGrant(), + "aws_kms_key": resourceAwsKmsKey(), + "aws_kms_ciphertext": resourceAwsKmsCiphertext(), + "aws_lambda_alias": resourceAwsLambdaAlias(), + "aws_lambda_event_source_mapping": resourceAwsLambdaEventSourceMapping(), + "aws_lambda_function_event_invoke_config": resourceAwsLambdaFunctionEventInvokeConfig(), + "aws_lambda_function": resourceAwsLambdaFunction(), + "aws_lambda_layer_version": resourceAwsLambdaLayerVersion(), + "aws_lambda_permission": resourceAwsLambdaPermission(), + "aws_lambda_provisioned_concurrency_config": resourceAwsLambdaProvisionedConcurrencyConfig(), + "aws_launch_configuration": resourceAwsLaunchConfiguration(), + "aws_launch_template": resourceAwsLaunchTemplate(), + "aws_lex_bot": resourceAwsLexBot(), + "aws_lex_bot_alias": resourceAwsLexBotAlias(), + "aws_lex_intent": resourceAwsLexIntent(), + "aws_lex_slot_type": resourceAwsLexSlotType(), + "aws_licensemanager_association": resourceAwsLicenseManagerAssociation(), + "aws_licensemanager_license_configuration": resourceAwsLicenseManagerLicenseConfiguration(), + "aws_lightsail_domain": resourceAwsLightsailDomain(), + "aws_lightsail_instance": resourceAwsLightsailInstance(), + "aws_lightsail_key_pair": resourceAwsLightsailKeyPair(), + "aws_lightsail_static_ip": resourceAwsLightsailStaticIp(), + "aws_lightsail_static_ip_attachment": resourceAwsLightsailStaticIpAttachment(), + "aws_lb_cookie_stickiness_policy": resourceAwsLBCookieStickinessPolicy(), + "aws_load_balancer_policy": resourceAwsLoadBalancerPolicy(), + "aws_load_balancer_backend_server_policy": resourceAwsLoadBalancerBackendServerPolicies(), + "aws_load_balancer_listener_policy": resourceAwsLoadBalancerListenerPolicies(), + "aws_lb_ssl_negotiation_policy": resourceAwsLBSSLNegotiationPolicy(), + "aws_macie_member_account_association": resourceAwsMacieMemberAccountAssociation(), + "aws_macie_s3_bucket_association": resourceAwsMacieS3BucketAssociation(), + "aws_main_route_table_association": resourceAwsMainRouteTableAssociation(), + "aws_mq_broker": resourceAwsMqBroker(), + "aws_mq_configuration": resourceAwsMqConfiguration(), + "aws_media_convert_queue": resourceAwsMediaConvertQueue(), + "aws_media_package_channel": resourceAwsMediaPackageChannel(), + "aws_media_store_container": resourceAwsMediaStoreContainer(), + "aws_media_store_container_policy": resourceAwsMediaStoreContainerPolicy(), + "aws_msk_cluster": resourceAwsMskCluster(), + "aws_msk_configuration": resourceAwsMskConfiguration(), + "aws_nat_gateway": resourceAwsNatGateway(), + "aws_network_acl": resourceAwsNetworkAcl(), + "aws_default_network_acl": resourceAwsDefaultNetworkAcl(), + "aws_neptune_cluster": resourceAwsNeptuneCluster(), + "aws_neptune_cluster_instance": resourceAwsNeptuneClusterInstance(), + "aws_neptune_cluster_parameter_group": resourceAwsNeptuneClusterParameterGroup(), + "aws_neptune_cluster_snapshot": resourceAwsNeptuneClusterSnapshot(), + "aws_neptune_event_subscription": resourceAwsNeptuneEventSubscription(), + "aws_neptune_parameter_group": resourceAwsNeptuneParameterGroup(), + "aws_neptune_subnet_group": resourceAwsNeptuneSubnetGroup(), + "aws_network_acl_rule": resourceAwsNetworkAclRule(), + "aws_network_interface": resourceAwsNetworkInterface(), + "aws_network_interface_attachment": resourceAwsNetworkInterfaceAttachment(), + "aws_networkfirewall_firewall": resourceAwsNetworkFirewallFirewall(), + "aws_networkfirewall_firewall_policy": resourceAwsNetworkFirewallFirewallPolicy(), + "aws_networkfirewall_logging_configuration": resourceAwsNetworkFirewallLoggingConfiguration(), + "aws_networkfirewall_rule_group": resourceAwsNetworkFirewallRuleGroup(), + "aws_opsworks_application": resourceAwsOpsworksApplication(), + "aws_opsworks_stack": resourceAwsOpsworksStack(), + "aws_opsworks_java_app_layer": resourceAwsOpsworksJavaAppLayer(), + "aws_opsworks_haproxy_layer": resourceAwsOpsworksHaproxyLayer(), + "aws_opsworks_static_web_layer": resourceAwsOpsworksStaticWebLayer(), + "aws_opsworks_php_app_layer": resourceAwsOpsworksPhpAppLayer(), + "aws_opsworks_rails_app_layer": resourceAwsOpsworksRailsAppLayer(), + "aws_opsworks_nodejs_app_layer": resourceAwsOpsworksNodejsAppLayer(), + "aws_opsworks_memcached_layer": resourceAwsOpsworksMemcachedLayer(), + "aws_opsworks_mysql_layer": resourceAwsOpsworksMysqlLayer(), + "aws_opsworks_ganglia_layer": resourceAwsOpsworksGangliaLayer(), + "aws_opsworks_custom_layer": resourceAwsOpsworksCustomLayer(), + "aws_opsworks_instance": resourceAwsOpsworksInstance(), + "aws_opsworks_user_profile": resourceAwsOpsworksUserProfile(), + "aws_opsworks_permission": resourceAwsOpsworksPermission(), + "aws_opsworks_rds_db_instance": resourceAwsOpsworksRdsDbInstance(), + "aws_organizations_organization": resourceAwsOrganizationsOrganization(), + "aws_organizations_account": resourceAwsOrganizationsAccount(), + "aws_organizations_policy": resourceAwsOrganizationsPolicy(), + "aws_organizations_policy_attachment": resourceAwsOrganizationsPolicyAttachment(), + "aws_organizations_organizational_unit": resourceAwsOrganizationsOrganizationalUnit(), + "aws_placement_group": resourceAwsPlacementGroup(), + "aws_proxy_protocol_policy": resourceAwsProxyProtocolPolicy(), + "aws_qldb_ledger": resourceAwsQLDBLedger(), + "aws_quicksight_group": resourceAwsQuickSightGroup(), + "aws_quicksight_user": resourceAwsQuickSightUser(), + "aws_ram_principal_association": resourceAwsRamPrincipalAssociation(), + "aws_ram_resource_association": resourceAwsRamResourceAssociation(), + "aws_ram_resource_share": resourceAwsRamResourceShare(), + "aws_ram_resource_share_accepter": resourceAwsRamResourceShareAccepter(), + "aws_rds_cluster": resourceAwsRDSCluster(), + "aws_rds_cluster_endpoint": resourceAwsRDSClusterEndpoint(), + "aws_rds_cluster_instance": resourceAwsRDSClusterInstance(), + "aws_rds_cluster_parameter_group": resourceAwsRDSClusterParameterGroup(), + "aws_rds_global_cluster": resourceAwsRDSGlobalCluster(), + "aws_redshift_cluster": resourceAwsRedshiftCluster(), + "aws_redshift_security_group": resourceAwsRedshiftSecurityGroup(), + "aws_redshift_parameter_group": resourceAwsRedshiftParameterGroup(), + "aws_redshift_subnet_group": resourceAwsRedshiftSubnetGroup(), + "aws_redshift_snapshot_copy_grant": resourceAwsRedshiftSnapshotCopyGrant(), + "aws_redshift_snapshot_schedule": resourceAwsRedshiftSnapshotSchedule(), + "aws_redshift_snapshot_schedule_association": resourceAwsRedshiftSnapshotScheduleAssociation(), + "aws_redshift_event_subscription": resourceAwsRedshiftEventSubscription(), + "aws_resourcegroups_group": resourceAwsResourceGroupsGroup(), + "aws_route53_delegation_set": resourceAwsRoute53DelegationSet(), + "aws_route53_query_log": resourceAwsRoute53QueryLog(), + "aws_route53_record": resourceAwsRoute53Record(), + "aws_route53_zone_association": resourceAwsRoute53ZoneAssociation(), + "aws_route53_vpc_association_authorization": resourceAwsRoute53VPCAssociationAuthorization(), + "aws_route53_zone": resourceAwsRoute53Zone(), + "aws_route53_health_check": resourceAwsRoute53HealthCheck(), + "aws_route53_resolver_endpoint": resourceAwsRoute53ResolverEndpoint(), + "aws_route53_resolver_query_log_config": resourceAwsRoute53ResolverQueryLogConfig(), + "aws_route53_resolver_query_log_config_association": resourceAwsRoute53ResolverQueryLogConfigAssociation(), + "aws_route53_resolver_rule_association": resourceAwsRoute53ResolverRuleAssociation(), + "aws_route53_resolver_rule": resourceAwsRoute53ResolverRule(), + "aws_route": resourceAwsRoute(), + "aws_route_table": resourceAwsRouteTable(), + "aws_default_route_table": resourceAwsDefaultRouteTable(), + "aws_route_table_association": resourceAwsRouteTableAssociation(), + "aws_sagemaker_code_repository": resourceAwsSagemakerCodeRepository(), + "aws_sagemaker_model": resourceAwsSagemakerModel(), + "aws_sagemaker_endpoint_configuration": resourceAwsSagemakerEndpointConfiguration(), + "aws_sagemaker_endpoint": resourceAwsSagemakerEndpoint(), + "aws_sagemaker_notebook_instance_lifecycle_configuration": resourceAwsSagemakerNotebookInstanceLifeCycleConfiguration(), + "aws_sagemaker_notebook_instance": resourceAwsSagemakerNotebookInstance(), + "aws_secretsmanager_secret": resourceAwsSecretsManagerSecret(), + "aws_secretsmanager_secret_policy": resourceAwsSecretsManagerSecretPolicy(), + "aws_secretsmanager_secret_version": resourceAwsSecretsManagerSecretVersion(), + "aws_secretsmanager_secret_rotation": resourceAwsSecretsManagerSecretRotation(), + "aws_ses_active_receipt_rule_set": resourceAwsSesActiveReceiptRuleSet(), + "aws_ses_domain_identity": resourceAwsSesDomainIdentity(), + "aws_ses_domain_identity_verification": resourceAwsSesDomainIdentityVerification(), + "aws_ses_domain_dkim": resourceAwsSesDomainDkim(), + "aws_ses_domain_mail_from": resourceAwsSesDomainMailFrom(), + "aws_ses_email_identity": resourceAwsSesEmailIdentity(), + "aws_ses_identity_policy": resourceAwsSesIdentityPolicy(), + "aws_ses_receipt_filter": resourceAwsSesReceiptFilter(), + "aws_ses_receipt_rule": resourceAwsSesReceiptRule(), + "aws_ses_receipt_rule_set": resourceAwsSesReceiptRuleSet(), + "aws_ses_configuration_set": resourceAwsSesConfigurationSet(), + "aws_ses_event_destination": resourceAwsSesEventDestination(), + "aws_ses_identity_notification_topic": resourceAwsSesNotificationTopic(), + "aws_ses_template": resourceAwsSesTemplate(), + "aws_s3_access_point": resourceAwsS3AccessPoint(), + "aws_s3_account_public_access_block": resourceAwsS3AccountPublicAccessBlock(), + "aws_s3_bucket": resourceAwsS3Bucket(), + "aws_s3_bucket_analytics_configuration": resourceAwsS3BucketAnalyticsConfiguration(), + "aws_s3_bucket_policy": resourceAwsS3BucketPolicy(), + "aws_s3_bucket_public_access_block": resourceAwsS3BucketPublicAccessBlock(), + "aws_s3_bucket_object": resourceAwsS3BucketObject(), + "aws_s3_bucket_ownership_controls": resourceAwsS3BucketOwnershipControls(), + "aws_s3_bucket_notification": resourceAwsS3BucketNotification(), + "aws_s3_bucket_metric": resourceAwsS3BucketMetric(), + "aws_s3_bucket_inventory": resourceAwsS3BucketInventory(), + "aws_s3control_bucket": resourceAwsS3ControlBucket(), + "aws_s3control_bucket_policy": resourceAwsS3ControlBucketPolicy(), + "aws_s3control_bucket_lifecycle_configuration": resourceAwsS3ControlBucketLifecycleConfiguration(), + "aws_s3outposts_endpoint": resourceAwsS3OutpostsEndpoint(), + "aws_security_group": resourceAwsSecurityGroup(), + "aws_network_interface_sg_attachment": resourceAwsNetworkInterfaceSGAttachment(), + "aws_default_security_group": resourceAwsDefaultSecurityGroup(), + "aws_security_group_rule": resourceAwsSecurityGroupRule(), + "aws_securityhub_account": resourceAwsSecurityHubAccount(), + "aws_securityhub_action_target": resourceAwsSecurityHubActionTarget(), + "aws_securityhub_member": resourceAwsSecurityHubMember(), + "aws_securityhub_product_subscription": resourceAwsSecurityHubProductSubscription(), + "aws_securityhub_standards_subscription": resourceAwsSecurityHubStandardsSubscription(), + "aws_serverlessapplicationrepository_cloudformation_stack": resourceAwsServerlessApplicationRepositoryCloudFormationStack(), + "aws_servicecatalog_portfolio": resourceAwsServiceCatalogPortfolio(), + "aws_service_discovery_http_namespace": resourceAwsServiceDiscoveryHttpNamespace(), + "aws_service_discovery_private_dns_namespace": resourceAwsServiceDiscoveryPrivateDnsNamespace(), + "aws_service_discovery_public_dns_namespace": resourceAwsServiceDiscoveryPublicDnsNamespace(), + "aws_service_discovery_service": resourceAwsServiceDiscoveryService(), + "aws_servicequotas_service_quota": resourceAwsServiceQuotasServiceQuota(), + "aws_shield_protection": resourceAwsShieldProtection(), + "aws_simpledb_domain": resourceAwsSimpleDBDomain(), + "aws_ssm_activation": resourceAwsSsmActivation(), + "aws_ssm_association": resourceAwsSsmAssociation(), + "aws_ssm_document": resourceAwsSsmDocument(), + "aws_ssm_maintenance_window": resourceAwsSsmMaintenanceWindow(), + "aws_ssm_maintenance_window_target": resourceAwsSsmMaintenanceWindowTarget(), + "aws_ssm_maintenance_window_task": resourceAwsSsmMaintenanceWindowTask(), + "aws_ssm_patch_baseline": resourceAwsSsmPatchBaseline(), + "aws_ssm_patch_group": resourceAwsSsmPatchGroup(), + "aws_ssm_parameter": resourceAwsSsmParameter(), + "aws_ssm_resource_data_sync": resourceAwsSsmResourceDataSync(), + "aws_storagegateway_cache": resourceAwsStorageGatewayCache(), + "aws_storagegateway_cached_iscsi_volume": resourceAwsStorageGatewayCachedIscsiVolume(), + "aws_storagegateway_gateway": resourceAwsStorageGatewayGateway(), + "aws_storagegateway_nfs_file_share": resourceAwsStorageGatewayNfsFileShare(), + "aws_storagegateway_smb_file_share": resourceAwsStorageGatewaySmbFileShare(), + "aws_storagegateway_stored_iscsi_volume": resourceAwsStorageGatewayStoredIscsiVolume(), + "aws_storagegateway_tape_pool": resourceAwsStorageGatewayTapePool(), + "aws_storagegateway_upload_buffer": resourceAwsStorageGatewayUploadBuffer(), + "aws_storagegateway_working_storage": resourceAwsStorageGatewayWorkingStorage(), + "aws_spot_datafeed_subscription": resourceAwsSpotDataFeedSubscription(), + "aws_spot_instance_request": resourceAwsSpotInstanceRequest(), + "aws_spot_fleet_request": resourceAwsSpotFleetRequest(), + "aws_sqs_queue": resourceAwsSqsQueue(), + "aws_sqs_queue_policy": resourceAwsSqsQueuePolicy(), + "aws_snapshot_create_volume_permission": resourceAwsSnapshotCreateVolumePermission(), + "aws_sns_platform_application": resourceAwsSnsPlatformApplication(), + "aws_sns_sms_preferences": resourceAwsSnsSmsPreferences(), + "aws_sns_topic": resourceAwsSnsTopic(), + "aws_sns_topic_policy": resourceAwsSnsTopicPolicy(), + "aws_sns_topic_subscription": resourceAwsSnsTopicSubscription(), + "aws_sfn_activity": resourceAwsSfnActivity(), + "aws_sfn_state_machine": resourceAwsSfnStateMachine(), + "aws_default_subnet": resourceAwsDefaultSubnet(), + "aws_subnet": resourceAwsSubnet(), + "aws_swf_domain": resourceAwsSwfDomain(), + "aws_transfer_server": resourceAwsTransferServer(), + "aws_transfer_ssh_key": resourceAwsTransferSshKey(), + "aws_transfer_user": resourceAwsTransferUser(), + "aws_volume_attachment": resourceAwsVolumeAttachment(), + "aws_vpc_dhcp_options_association": resourceAwsVpcDhcpOptionsAssociation(), + "aws_default_vpc_dhcp_options": resourceAwsDefaultVpcDhcpOptions(), + "aws_vpc_dhcp_options": resourceAwsVpcDhcpOptions(), + "aws_vpc_peering_connection": resourceAwsVpcPeeringConnection(), + "aws_vpc_peering_connection_accepter": resourceAwsVpcPeeringConnectionAccepter(), + "aws_vpc_peering_connection_options": resourceAwsVpcPeeringConnectionOptions(), + "aws_default_vpc": resourceAwsDefaultVpc(), + "aws_vpc": resourceAwsVpc(), + "aws_vpc_endpoint": resourceAwsVpcEndpoint(), + "aws_vpc_endpoint_connection_notification": resourceAwsVpcEndpointConnectionNotification(), + "aws_vpc_endpoint_route_table_association": resourceAwsVpcEndpointRouteTableAssociation(), + "aws_vpc_endpoint_subnet_association": resourceAwsVpcEndpointSubnetAssociation(), + "aws_vpc_endpoint_service": resourceAwsVpcEndpointService(), + "aws_vpc_endpoint_service_allowed_principal": resourceAwsVpcEndpointServiceAllowedPrincipal(), + "aws_vpc_ipv4_cidr_block_association": resourceAwsVpcIpv4CidrBlockAssociation(), + "aws_vpn_connection": resourceAwsVpnConnection(), + "aws_vpn_connection_route": resourceAwsVpnConnectionRoute(), + "aws_vpn_gateway": resourceAwsVpnGateway(), + "aws_vpn_gateway_attachment": resourceAwsVpnGatewayAttachment(), + "aws_vpn_gateway_route_propagation": resourceAwsVpnGatewayRoutePropagation(), + "aws_waf_byte_match_set": resourceAwsWafByteMatchSet(), + "aws_waf_ipset": resourceAwsWafIPSet(), + "aws_waf_rate_based_rule": resourceAwsWafRateBasedRule(), + "aws_waf_regex_match_set": resourceAwsWafRegexMatchSet(), + "aws_waf_regex_pattern_set": resourceAwsWafRegexPatternSet(), + "aws_waf_rule": resourceAwsWafRule(), + "aws_waf_rule_group": resourceAwsWafRuleGroup(), + "aws_waf_size_constraint_set": resourceAwsWafSizeConstraintSet(), + "aws_waf_web_acl": resourceAwsWafWebAcl(), + "aws_waf_xss_match_set": resourceAwsWafXssMatchSet(), + "aws_waf_sql_injection_match_set": resourceAwsWafSqlInjectionMatchSet(), + "aws_waf_geo_match_set": resourceAwsWafGeoMatchSet(), + "aws_wafregional_byte_match_set": resourceAwsWafRegionalByteMatchSet(), + "aws_wafregional_geo_match_set": resourceAwsWafRegionalGeoMatchSet(), + "aws_wafregional_ipset": resourceAwsWafRegionalIPSet(), + "aws_wafregional_rate_based_rule": resourceAwsWafRegionalRateBasedRule(), + "aws_wafregional_regex_match_set": resourceAwsWafRegionalRegexMatchSet(), + "aws_wafregional_regex_pattern_set": resourceAwsWafRegionalRegexPatternSet(), + "aws_wafregional_rule": resourceAwsWafRegionalRule(), + "aws_wafregional_rule_group": resourceAwsWafRegionalRuleGroup(), + "aws_wafregional_size_constraint_set": resourceAwsWafRegionalSizeConstraintSet(), + "aws_wafregional_sql_injection_match_set": resourceAwsWafRegionalSqlInjectionMatchSet(), + "aws_wafregional_xss_match_set": resourceAwsWafRegionalXssMatchSet(), + "aws_wafregional_web_acl": resourceAwsWafRegionalWebAcl(), + "aws_wafregional_web_acl_association": resourceAwsWafRegionalWebAclAssociation(), + "aws_wafv2_ip_set": resourceAwsWafv2IPSet(), + "aws_wafv2_regex_pattern_set": resourceAwsWafv2RegexPatternSet(), + "aws_wafv2_rule_group": resourceAwsWafv2RuleGroup(), + "aws_wafv2_web_acl": resourceAwsWafv2WebACL(), + "aws_wafv2_web_acl_association": resourceAwsWafv2WebACLAssociation(), + "aws_wafv2_web_acl_logging_configuration": resourceAwsWafv2WebACLLoggingConfiguration(), + "aws_worklink_fleet": resourceAwsWorkLinkFleet(), + "aws_worklink_website_certificate_authority_association": resourceAwsWorkLinkWebsiteCertificateAuthorityAssociation(), + "aws_workspaces_directory": resourceAwsWorkspacesDirectory(), + "aws_workspaces_workspace": resourceAwsWorkspacesWorkspace(), + "aws_batch_compute_environment": resourceAwsBatchComputeEnvironment(), + "aws_batch_job_definition": resourceAwsBatchJobDefinition(), + "aws_batch_job_queue": resourceAwsBatchJobQueue(), + "aws_pinpoint_app": resourceAwsPinpointApp(), + "aws_pinpoint_adm_channel": resourceAwsPinpointADMChannel(), + "aws_pinpoint_apns_channel": resourceAwsPinpointAPNSChannel(), + "aws_pinpoint_apns_sandbox_channel": resourceAwsPinpointAPNSSandboxChannel(), + "aws_pinpoint_apns_voip_channel": resourceAwsPinpointAPNSVoipChannel(), + "aws_pinpoint_apns_voip_sandbox_channel": resourceAwsPinpointAPNSVoipSandboxChannel(), + "aws_pinpoint_baidu_channel": resourceAwsPinpointBaiduChannel(), + "aws_pinpoint_email_channel": resourceAwsPinpointEmailChannel(), + "aws_pinpoint_event_stream": resourceAwsPinpointEventStream(), + "aws_pinpoint_gcm_channel": resourceAwsPinpointGCMChannel(), + "aws_pinpoint_sms_channel": resourceAwsPinpointSMSChannel(), + "aws_xray_encryption_config": resourceAwsXrayEncryptionConfig(), + "aws_xray_group": resourceAwsXrayGroup(), + "aws_xray_sampling_rule": resourceAwsXraySamplingRule(), + "aws_workspaces_ip_group": resourceAwsWorkspacesIpGroup(), // ALBs are actually LBs because they can be type `network` or `application` // To avoid regressions, we will add a new resource for each and they both point diff --git a/aws/resource_aws_serverlessrepository_stack.go b/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go similarity index 83% rename from aws/resource_aws_serverlessrepository_stack.go rename to aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go index 465a7f2c5b8..2f69c475d34 100644 --- a/aws/resource_aws_serverlessrepository_stack.go +++ b/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go @@ -17,27 +17,27 @@ import ( "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" cffinder "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/finder" cfwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/waiter" - "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/serverlessrepository/finder" - "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/serverlessrepository/waiter" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/serverlessapplicationrepository/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/serverlessapplicationrepository/waiter" ) -const serverlessRepositoryStackNamePrefix = "serverlessrepo-" +const serverlessApplicationRepositoryCloudFormationStackNamePrefix = "serverlessrepo-" -func resourceAwsServerlessRepositoryStack() *schema.Resource { +func resourceAwsServerlessApplicationRepositoryCloudFormationStack() *schema.Resource { return &schema.Resource{ - Create: resourceAwsServerlessRepositoryStackCreate, - Read: resourceAwsServerlessRepositoryStackRead, - Update: resourceAwsServerlessRepositoryStackUpdate, - Delete: resourceAwsServerlessRepositoryStackDelete, + Create: resourceAwsServerlessApplicationRepositoryCloudFormationStackCreate, + Read: resourceAwsServerlessApplicationRepositoryCloudFormationStackRead, + Update: resourceAwsServerlessApplicationRepositoryCloudFormationStackUpdate, + Delete: resourceAwsServerlessApplicationRepositoryCloudFormationStackDelete, Importer: &schema.ResourceImporter{ - State: resourceAwsServerlessRepositoryStackImport, + State: resourceAwsServerlessApplicationRepositoryCloudFormationStackImport, }, Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(waiter.StackCreatedDefaultTimeout), - Update: schema.DefaultTimeout(waiter.StackUpdatedDefaultTimeout), - Delete: schema.DefaultTimeout(waiter.StackDeletedDefaultTimeout), + Create: schema.DefaultTimeout(waiter.CloudFormationStackCreatedDefaultTimeout), + Update: schema.DefaultTimeout(waiter.CloudFormationStackUpdatedDefaultTimeout), + Delete: schema.DefaultTimeout(waiter.CloudFormationStackDeletedDefaultTimeout), }, Schema: map[string]*schema.Schema{ @@ -84,7 +84,7 @@ func resourceAwsServerlessRepositoryStack() *schema.Resource { } } -func resourceAwsServerlessRepositoryStackCreate(d *schema.ResourceData, meta interface{}) error { +func resourceAwsServerlessApplicationRepositoryCloudFormationStackCreate(d *schema.ResourceData, meta interface{}) error { serverlessConn := meta.(*AWSClient).serverlessapplicationrepositoryconn cfConn := meta.(*AWSClient).cfconn @@ -100,7 +100,7 @@ func resourceAwsServerlessRepositoryStackCreate(d *schema.ResourceData, meta int changeSetRequest.SemanticVersion = aws.String(version) } if v, ok := d.GetOk("parameters"); ok { - changeSetRequest.ParameterOverrides = expandServerlessRepositoryChangeSetParameters(v.(map[string]interface{})) + changeSetRequest.ParameterOverrides = expandServerlessRepositoryCloudFormationChangeSetParameters(v.(map[string]interface{})) } log.Printf("[DEBUG] Creating Serverless Application Repository change set: %s", changeSetRequest) @@ -136,10 +136,10 @@ func resourceAwsServerlessRepositoryStackCreate(d *schema.ResourceData, meta int log.Printf("[INFO] Serverless Application Repository CloudFormation Stack (%s) created", d.Id()) - return resourceAwsServerlessRepositoryStackRead(d, meta) + return resourceAwsServerlessApplicationRepositoryCloudFormationStackRead(d, meta) } -func resourceAwsServerlessRepositoryStackRead(d *schema.ResourceData, meta interface{}) error { +func resourceAwsServerlessApplicationRepositoryCloudFormationStackRead(d *schema.ResourceData, meta interface{}) error { serverlessConn := meta.(*AWSClient).serverlessapplicationrepositoryconn cfConn := meta.(*AWSClient).cfconn ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig @@ -178,10 +178,10 @@ func resourceAwsServerlessRepositoryStackRead(d *schema.ResourceData, meta inter // Serverless Application Repo prefixes the stack name with "serverlessrepo-", // so remove it from the saved string - stackName := strings.TrimPrefix(aws.StringValue(stack.StackName), serverlessRepositoryStackNamePrefix) + stackName := strings.TrimPrefix(aws.StringValue(stack.StackName), serverlessApplicationRepositoryCloudFormationStackNamePrefix) d.Set("name", &stackName) - if err = d.Set("parameters", flattenSomeCloudFormationParameters(stack.Parameters, parameterDefinitions)); err != nil { + if err = d.Set("parameters", flattenNonDefaultServerlessApplicationCloudFormationParameters(stack.Parameters, parameterDefinitions)); err != nil { return fmt.Errorf("failed to set parameters: %w", err) } @@ -200,7 +200,7 @@ func resourceAwsServerlessRepositoryStackRead(d *schema.ResourceData, meta inter return nil } -func flattenSomeCloudFormationParameters(cfParams []*cloudformation.Parameter, parameterDefinitions map[string]*serverlessrepository.ParameterDefinition) map[string]interface{} { +func flattenNonDefaultServerlessApplicationCloudFormationParameters(cfParams []*cloudformation.Parameter, parameterDefinitions map[string]*serverlessrepository.ParameterDefinition) map[string]interface{} { params := make(map[string]interface{}, len(cfParams)) for _, p := range cfParams { key := aws.StringValue(p.ParameterKey) @@ -220,7 +220,7 @@ func flattenServerlessRepositoryParameterDefinitions(parameterDefinitions []*ser return result } -func resourceAwsServerlessRepositoryStackUpdate(d *schema.ResourceData, meta interface{}) error { +func resourceAwsServerlessApplicationRepositoryCloudFormationStackUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).cfconn input := &cloudformation.CreateChangeSetInput{ @@ -273,10 +273,10 @@ func resourceAwsServerlessRepositoryStackUpdate(d *schema.ResourceData, meta int log.Printf("[INFO] Serverless Application Repository CloudFormation Stack (%s) updated", d.Id()) - return resourceAwsServerlessRepositoryStackRead(d, meta) + return resourceAwsServerlessApplicationRepositoryCloudFormationStackRead(d, meta) } -func resourceAwsServerlessRepositoryStackDelete(d *schema.ResourceData, meta interface{}) error { +func resourceAwsServerlessApplicationRepositoryCloudFormationStackDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).cfconn requestToken := resource.UniqueId() @@ -303,13 +303,13 @@ func resourceAwsServerlessRepositoryStackDelete(d *schema.ResourceData, meta int return nil } -func resourceAwsServerlessRepositoryStackImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { +func resourceAwsServerlessApplicationRepositoryCloudFormationStackImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { stackID := d.Id() // If this isn't an ARN, it's the stack name if _, err := arn.Parse(stackID); err != nil { - if !strings.HasPrefix(stackID, serverlessRepositoryStackNamePrefix) { - stackID = serverlessRepositoryStackNamePrefix + stackID + if !strings.HasPrefix(stackID, serverlessApplicationRepositoryCloudFormationStackNamePrefix) { + stackID = serverlessApplicationRepositoryCloudFormationStackNamePrefix + stackID } } @@ -342,7 +342,7 @@ func resourceAwsServerlessRepositoryStackImport(d *schema.ResourceData, meta int return []*schema.ResourceData{d}, nil } -func expandServerlessRepositoryChangeSetParameters(params map[string]interface{}) []*serverlessrepository.ParameterValue { +func expandServerlessRepositoryCloudFormationChangeSetParameters(params map[string]interface{}) []*serverlessrepository.ParameterValue { var appParams []*serverlessrepository.ParameterValue for k, v := range params { appParams = append(appParams, &serverlessrepository.ParameterValue{ diff --git a/aws/resource_aws_serverlessrepository_stack_test.go b/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack_test.go similarity index 88% rename from aws/resource_aws_serverlessrepository_stack_test.go rename to aws/resource_aws_serverlessapplicationrepository_cloudformation_stack_test.go index 46e6308f44c..556eabb6158 100644 --- a/aws/resource_aws_serverlessrepository_stack_test.go +++ b/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack_test.go @@ -12,14 +12,14 @@ import ( "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfawsresource" ) -// Since aws_serverlessrepository_stack creates CloudFormation stacks, +// Since aws_serverlessapplicationrepository_cloudformation_stack creates CloudFormation stacks, // the aws_cloudformation_stack sweeper will clean these up as well. func TestAccAwsServerlessRepositoryStack_basic(t *testing.T) { var stack cloudformation.Stack stackName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_serverlessrepository_stack.postgres-rotator" + resourceName := "aws_serverlessapplicationrepository_cloudformation_stack.postgres-rotator" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -69,7 +69,7 @@ func TestAccAwsServerlessRepositoryStack_disappears(t *testing.T) { var stack cloudformation.Stack stackName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_serverlessrepository_stack.postgres-rotator" + resourceName := "aws_serverlessapplicationrepository_cloudformation_stack.postgres-rotator" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -80,7 +80,7 @@ func TestAccAwsServerlessRepositoryStack_disappears(t *testing.T) { Config: testAccAwsServerlessRepositoryStackConfig(stackName), Check: resource.ComposeTestCheckFunc( testAccCheckServerlessRepositoryStackExists(resourceName, &stack), - testAccCheckResourceDisappears(testAccProvider, resourceAwsServerlessRepositoryStack(), resourceName), + testAccCheckResourceDisappears(testAccProvider, resourceAwsServerlessApplicationRepositoryCloudFormationStack(), resourceName), ), ExpectNonEmptyPlan: true, }, @@ -97,7 +97,7 @@ func TestAccAwsServerlessRepositoryStack_versioned(t *testing.T) { version2 = "1.1.36" ) - resourceName := "aws_serverlessrepository_stack.postgres-rotator" + resourceName := "aws_serverlessapplicationrepository_cloudformation_stack.postgres-rotator" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -148,7 +148,7 @@ func TestAccAwsServerlessRepositoryStack_paired(t *testing.T) { const version = "1.1.36" - resourceName := "aws_serverlessrepository_stack.postgres-rotator" + resourceName := "aws_serverlessapplicationrepository_cloudformation_stack.postgres-rotator" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -173,7 +173,7 @@ func TestAccAwsServerlessRepositoryStack_Tags(t *testing.T) { var stack cloudformation.Stack stackName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_serverlessrepository_stack.postgres-rotator" + resourceName := "aws_serverlessapplicationrepository_cloudformation_stack.postgres-rotator" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -219,7 +219,7 @@ func TestAccAwsServerlessRepositoryStack_update(t *testing.T) { initialName := acctest.RandomWithPrefix("FuncName1") updatedName := acctest.RandomWithPrefix("FuncName2") - resourceName := "aws_serverlessrepository_stack.postgres-rotator" + resourceName := "aws_serverlessapplicationrepository_cloudformation_stack.postgres-rotator" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -281,7 +281,7 @@ func testAccAwsServerlessRepositoryStackNameImportStateIdFunc(resourceName strin return "", fmt.Errorf("Not found: %s", resourceName) } - return fmt.Sprintf("%s%s", serverlessRepositoryStackNamePrefix, rs.Primary.Attributes["name"]), nil + return fmt.Sprintf("%s%s", serverlessApplicationRepositoryCloudFormationStackNamePrefix, rs.Primary.Attributes["name"]), nil } } @@ -300,7 +300,7 @@ func testAccAwsServerlessRepositoryStackConfig(stackName string) string { return composeConfig( testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication, fmt.Sprintf(` -resource "aws_serverlessrepository_stack" "postgres-rotator" { +resource "aws_serverlessapplicationrepository_cloudformation_stack" "postgres-rotator" { name = "%[1]s" application_id = local.postgres_single_user_rotator_arn capabilities = [ @@ -321,7 +321,7 @@ func testAccAWSServerlessRepositoryStackConfig_updateInitial(stackName, function return composeConfig( testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication, fmt.Sprintf(` -resource "aws_serverlessrepository_stack" "postgres-rotator" { +resource "aws_serverlessapplicationrepository_cloudformation_stack" "postgres-rotator" { name = "%[1]s" application_id = local.postgres_single_user_rotator_arn capabilities = [ @@ -345,7 +345,7 @@ func testAccAWSServerlessRepositoryStackConfig_updateUpdated(stackName, function return composeConfig( testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication, fmt.Sprintf(` -resource "aws_serverlessrepository_stack" "postgres-rotator" { +resource "aws_serverlessapplicationrepository_cloudformation_stack" "postgres-rotator" { name = "%[1]s" application_id = local.postgres_single_user_rotator_arn capabilities = [ @@ -369,7 +369,7 @@ func testAccAWSServerlessRepositoryStackConfig_versioned(stackName, version stri return composeConfig( testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication, fmt.Sprintf(` -resource "aws_serverlessrepository_stack" "postgres-rotator" { +resource "aws_serverlessapplicationrepository_cloudformation_stack" "postgres-rotator" { name = "%[1]s" application_id = local.postgres_single_user_rotator_arn semantic_version = "%[2]s" @@ -387,7 +387,7 @@ func testAccAWSServerlessRepositoryStackConfig_versioned2(stackName, version str return composeConfig( testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication, fmt.Sprintf(` -resource "aws_serverlessrepository_stack" "postgres-rotator" { +resource "aws_serverlessapplicationrepository_cloudformation_stack" "postgres-rotator" { name = "%[1]s" application_id = local.postgres_single_user_rotator_arn capabilities = [ @@ -409,18 +409,18 @@ func testAccAWSServerlessRepositoryStackConfig_versionedPaired(stackName, versio return composeConfig( testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication, fmt.Sprintf(` -resource "aws_serverlessrepository_stack" "postgres-rotator" { +resource "aws_serverlessapplicationrepository_cloudformation_stack" "postgres-rotator" { name = "%[1]s" - application_id = data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator.application_id - semantic_version = data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator.semantic_version - capabilities = data.aws_serverlessrepository_application.secrets_manager_postgres_single_user_rotator.required_capabilities + application_id = data.aws_serverlessapplicationrepository_application.secrets_manager_postgres_single_user_rotator.application_id + semantic_version = data.aws_serverlessapplicationrepository_application.secrets_manager_postgres_single_user_rotator.semantic_version + capabilities = data.aws_serverlessapplicationrepository_application.secrets_manager_postgres_single_user_rotator.required_capabilities parameters = { functionName = "func-%[1]s" endpoint = "secretsmanager.${data.aws_region.current.name}.${data.aws_partition.current.dns_suffix}" } } -data "aws_serverlessrepository_application" "secrets_manager_postgres_single_user_rotator" { +data "aws_serverlessapplicationrepository_application" "secrets_manager_postgres_single_user_rotator" { application_id = local.postgres_single_user_rotator_arn semantic_version = "%[2]s" } @@ -433,7 +433,7 @@ func testAccAwsServerlessRepositoryStackConfigTags1(rName, tagKey1, tagValue1 st return composeConfig( testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication, fmt.Sprintf(` -resource "aws_serverlessrepository_stack" "postgres-rotator" { +resource "aws_serverlessapplicationrepository_cloudformation_stack" "postgres-rotator" { name = "%[1]s" application_id = local.postgres_single_user_rotator_arn capabilities = [ @@ -457,7 +457,7 @@ func testAccAwsServerlessRepositoryStackConfigTags2(rName, tagKey1, tagValue1, t return composeConfig( testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication, fmt.Sprintf(` -resource "aws_serverlessrepository_stack" "postgres-rotator" { +resource "aws_serverlessapplicationrepository_cloudformation_stack" "postgres-rotator" { name = "%[1]s" application_id = local.postgres_single_user_rotator_arn capabilities = [ diff --git a/docs/roadmaps/2020_August_to_October.md b/docs/roadmaps/2020_August_to_October.md index 37ba4933c57..6ea8ac4413f 100644 --- a/docs/roadmaps/2020_August_to_October.md +++ b/docs/roadmaps/2020_August_to_October.md @@ -67,11 +67,11 @@ Support for AWS Serverless Application Repository will include: New Resource(s): -- aws_serverlessrepository_stack +- aws_serverlessapplicationrepository_cloudformation_stack New Data Source(s): -- aws_serverlessrepository_application +- aws_serverlessapplicationrepository_application ## Issues and Enhancements diff --git a/website/docs/d/serverlessrepository_application.html.markdown b/website/docs/d/serverlessapplicationrepository_application.html.markdown similarity index 66% rename from website/docs/d/serverlessrepository_application.html.markdown rename to website/docs/d/serverlessapplicationrepository_application.html.markdown index ed14ea2a670..939c006e781 100644 --- a/website/docs/d/serverlessrepository_application.html.markdown +++ b/website/docs/d/serverlessapplicationrepository_application.html.markdown @@ -1,27 +1,27 @@ --- subcategory: "Serverless Application Repository" layout: "aws" -page_title: "AWS: aws_serverlessrepository_application" +page_title: "AWS: aws_serverlessapplicationrepository_application" description: |- Get information on a AWS Serverless Application Repository application --- -# Data Source: aws_serverlessrepository_application +# Data Source: aws_serverlessapplicationrepository_application Use this data source to get information about an AWS Serverless Application Repository application. For example, this can be used to determine the required `capabilities` for an application. ## Example Usage ```hcl -data "aws_serverlessrepository_application" "example" { +data "aws_serverlessapplicationrepository_application" "example" { application_id = "arn:aws:serverlessrepo:us-east-1:123456789012:applications/ExampleApplication" } -resource "aws_serverlessrepository_stack" "example" { +resource "aws_serverlessapplicationrepository_cloudformation_stack" "example" { name = "Example" - application_id = data.aws_serverlessrepository_application.example.application_id - semantic_version = data.aws_serverlessrepository_application.example.semantic_version - capabilities = data.aws_serverlessrepository_application.example.required_capabilities + application_id = data.aws_serverlessapplicationrepository_application.example.application_id + semantic_version = data.aws_serverlessapplicationrepository_application.example.semantic_version + capabilities = data.aws_serverlessapplicationrepository_application.example.required_capabilities } ``` diff --git a/website/docs/r/serverlessrepository_stack.html.markdown b/website/docs/r/serverlessapplicationrepository_stack.html.markdown similarity index 84% rename from website/docs/r/serverlessrepository_stack.html.markdown rename to website/docs/r/serverlessapplicationrepository_stack.html.markdown index 363dea5d343..9652fb8d718 100644 --- a/website/docs/r/serverlessrepository_stack.html.markdown +++ b/website/docs/r/serverlessapplicationrepository_stack.html.markdown @@ -1,19 +1,19 @@ --- subcategory: "Serverless Application Repository" layout: "aws" -page_title: "AWS: aws_serverlessrepository_stack" +page_title: "AWS: aws_serverlessapplicationrepository_cloudformation_stack" description: |- Deploys an Application CloudFormation Stack from the Serverless Application Repository. --- -# Resource: aws_serverlessrepository_stack +# Resource: aws_serverlessapplicationrepository_cloudformation_stack Deploys an Application CloudFormation Stack from the Serverless Application Repository. ## Example Usage ```hcl -resource "aws_serverlessrepository_stack" "postgres-rotator" { +resource "aws_serverlessapplicationrepository_cloudformation_stack" "postgres-rotator" { name = "postgres-rotator" application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" capabilities = [ @@ -54,5 +54,5 @@ In addition to all arguments above, the following attributes are exported: Serverless Application Repository Stack can be imported using the CloudFormation Stack name (with or without the `serverlessrepo-` prefix) or the CloudFormation Stack ID, e.g. ``` -$ terraform import aws_serverlessrepository_stack.example serverlessrepo-postgres-rotator +$ terraform import aws_serverlessapplicationrepository_cloudformation_stack.example serverlessrepo-postgres-rotator ``` From 49c7ded5cc1f74386561b8f0c9d0c327d6932bda Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 24 Nov 2020 00:06:23 -0800 Subject: [PATCH 37/42] Renames file --- ...rlessapplicationrepository_cloudformation_stack.html.markdown} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename website/docs/r/{serverlessapplicationrepository_stack.html.markdown => serverlessapplicationrepository_cloudformation_stack.html.markdown} (100%) diff --git a/website/docs/r/serverlessapplicationrepository_stack.html.markdown b/website/docs/r/serverlessapplicationrepository_cloudformation_stack.html.markdown similarity index 100% rename from website/docs/r/serverlessapplicationrepository_stack.html.markdown rename to website/docs/r/serverlessapplicationrepository_cloudformation_stack.html.markdown From 0908954b8f955642b8c552faa1e30837c90a8d87 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 24 Nov 2020 12:02:38 -0800 Subject: [PATCH 38/42] More renaming --- ...sapplicationrepository_application_test.go | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/aws/data_source_aws_serverlessapplicationrepository_application_test.go b/aws/data_source_aws_serverlessapplicationrepository_application_test.go index ee5dfb2d1a7..930545879f7 100644 --- a/aws/data_source_aws_serverlessapplicationrepository_application_test.go +++ b/aws/data_source_aws_serverlessapplicationrepository_application_test.go @@ -10,7 +10,7 @@ import ( "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfawsresource" ) -func TestAccDataSourceAwsServerlessRepositoryApplication_Basic(t *testing.T) { +func TestAccDataSourceAwsServerlessApplicationRepositoryApplication_Basic(t *testing.T) { datasourceName := "data.aws_serverlessapplicationrepository_application.secrets_manager_postgres_single_user_rotator" resource.ParallelTest(t, resource.TestCase{ @@ -18,9 +18,9 @@ func TestAccDataSourceAwsServerlessRepositoryApplication_Basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig, + Config: testAccCheckAwsServerlessApplicationRepositoryApplicationDataSourceConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckAwsServerlessRepositoryApplicationDataSourceID(datasourceName), + testAccCheckAwsServerlessApplicationRepositoryApplicationDataSourceID(datasourceName), resource.TestCheckResourceAttr(datasourceName, "name", "SecretsManagerRDSPostgreSQLRotationSingleUser"), resource.TestCheckResourceAttrSet(datasourceName, "semantic_version"), resource.TestCheckResourceAttrSet(datasourceName, "source_code_url"), @@ -29,13 +29,13 @@ func TestAccDataSourceAwsServerlessRepositoryApplication_Basic(t *testing.T) { ), }, { - Config: testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_NonExistent, + Config: testAccCheckAwsServerlessApplicationRepositoryApplicationDataSourceConfig_NonExistent, ExpectError: regexp.MustCompile(`error getting Serverless Application Repository application`), }, }, }) } -func TestAccDataSourceAwsServerlessRepositoryApplication_Versioned(t *testing.T) { +func TestAccDataSourceAwsServerlessApplicationRepositoryApplication_Versioned(t *testing.T) { datasourceName := "data.aws_serverlessapplicationrepository_application.secrets_manager_postgres_single_user_rotator" const ( @@ -48,9 +48,9 @@ func TestAccDataSourceAwsServerlessRepositoryApplication_Versioned(t *testing.T) Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_Versioned(version1), + Config: testAccCheckAwsServerlessApplicationRepositoryApplicationDataSourceConfig_Versioned(version1), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsServerlessRepositoryApplicationDataSourceID(datasourceName), + testAccCheckAwsServerlessApplicationRepositoryApplicationDataSourceID(datasourceName), resource.TestCheckResourceAttr(datasourceName, "name", "SecretsManagerRDSPostgreSQLRotationSingleUser"), resource.TestCheckResourceAttr(datasourceName, "semantic_version", version1), resource.TestCheckResourceAttrSet(datasourceName, "source_code_url"), @@ -59,9 +59,9 @@ func TestAccDataSourceAwsServerlessRepositoryApplication_Versioned(t *testing.T) ), }, { - Config: testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_Versioned(version2), + Config: testAccCheckAwsServerlessApplicationRepositoryApplicationDataSourceConfig_Versioned(version2), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsServerlessRepositoryApplicationDataSourceID(datasourceName), + testAccCheckAwsServerlessApplicationRepositoryApplicationDataSourceID(datasourceName), resource.TestCheckResourceAttr(datasourceName, "name", "SecretsManagerRDSPostgreSQLRotationSingleUser"), resource.TestCheckResourceAttr(datasourceName, "semantic_version", version2), resource.TestCheckResourceAttrSet(datasourceName, "source_code_url"), @@ -72,14 +72,14 @@ func TestAccDataSourceAwsServerlessRepositoryApplication_Versioned(t *testing.T) ), }, { - Config: testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_Versioned_NonExistent, + Config: testAccCheckAwsServerlessApplicationRepositoryApplicationDataSourceConfig_Versioned_NonExistent, ExpectError: regexp.MustCompile(`error getting Serverless Application Repository application`), }, }, }) } -func testAccCheckAwsServerlessRepositoryApplicationDataSourceID(n string) resource.TestCheckFunc { +func testAccCheckAwsServerlessApplicationRepositoryApplicationDataSourceID(n string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -93,13 +93,13 @@ func testAccCheckAwsServerlessRepositoryApplicationDataSourceID(n string) resour } } -const testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig = testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication + ` +const testAccCheckAwsServerlessApplicationRepositoryApplicationDataSourceConfig = testAccCheckAwsServerlessApplicationRepositoryPostgresSingleUserRotatorApplication + ` data "aws_serverlessapplicationrepository_application" "secrets_manager_postgres_single_user_rotator" { application_id = local.postgres_single_user_rotator_arn } ` -const testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_NonExistent = ` +const testAccCheckAwsServerlessApplicationRepositoryApplicationDataSourceConfig_NonExistent = ` data "aws_serverlessapplicationrepository_application" "no_such_function" { application_id = "arn:${data.aws_partition.current.partition}:serverlessrepo:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:applications/ThisFunctionDoesNotExist" } @@ -109,9 +109,9 @@ data "aws_partition" "current" {} data "aws_region" "current" {} ` -func testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_Versioned(version string) string { +func testAccCheckAwsServerlessApplicationRepositoryApplicationDataSourceConfig_Versioned(version string) string { return composeConfig( - testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication, + testAccCheckAwsServerlessApplicationRepositoryPostgresSingleUserRotatorApplication, fmt.Sprintf(` data "aws_serverlessapplicationrepository_application" "secrets_manager_postgres_single_user_rotator" { application_id = local.postgres_single_user_rotator_arn @@ -120,7 +120,7 @@ data "aws_serverlessapplicationrepository_application" "secrets_manager_postgres `, version)) } -const testAccCheckAwsServerlessRepositoryApplicationDataSourceConfig_Versioned_NonExistent = testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication + ` +const testAccCheckAwsServerlessApplicationRepositoryApplicationDataSourceConfig_Versioned_NonExistent = testAccCheckAwsServerlessApplicationRepositoryPostgresSingleUserRotatorApplication + ` data "aws_serverlessapplicationrepository_application" "secrets_manager_postgres_single_user_rotator" { application_id = local.postgres_single_user_rotator_arn semantic_version = "42.13.7" From 124075f3da9a7ead334812cb3a2838f8331f7458 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 24 Nov 2020 16:21:33 -0800 Subject: [PATCH 39/42] Removes unneeded ForceNew from semantic_version attribute --- aws/resource_aws_cloudformation_stack_test.go | 10 ++ ...licationrepository_cloudformation_stack.go | 122 +++++++----------- ...ionrepository_cloudformation_stack_test.go | 107 +++++++-------- ...ository_cloudformation_stack.html.markdown | 3 +- 4 files changed, 111 insertions(+), 131 deletions(-) diff --git a/aws/resource_aws_cloudformation_stack_test.go b/aws/resource_aws_cloudformation_stack_test.go index 0c34a757bd0..d94ae940605 100644 --- a/aws/resource_aws_cloudformation_stack_test.go +++ b/aws/resource_aws_cloudformation_stack_test.go @@ -518,6 +518,16 @@ func testAccCheckAWSCloudFormationDestroy(s *terraform.State) error { return nil } +func testAccCheckCloudFormationStackNotRecreated(i, j *cloudformation.Stack) resource.TestCheckFunc { + return func(s *terraform.State) error { + if aws.StringValue(i.StackId) != aws.StringValue(j.StackId) { + return fmt.Errorf("CloudFormation stack recreated") + } + + return nil + } +} + func testAccCheckCloudFormationStackDisappears(stack *cloudformation.Stack) resource.TestCheckFunc { return func(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).cfconn diff --git a/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go b/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go index 2f69c475d34..9d4196db89d 100644 --- a/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go +++ b/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go @@ -54,8 +54,7 @@ func resourceAwsServerlessApplicationRepositoryCloudFormationStack() *schema.Res }, "capabilities": { Type: schema.TypeSet, - Optional: true, - Computed: true, + Required: true, Elem: &schema.Schema{ Type: schema.TypeString, ValidateFunc: validation.StringInSlice(serverlessrepository.Capability_Values(), false), @@ -72,7 +71,6 @@ func resourceAwsServerlessApplicationRepositoryCloudFormationStack() *schema.Res Type: schema.TypeString, Optional: true, Computed: true, - ForceNew: true, }, "outputs": { Type: schema.TypeMap, @@ -85,48 +83,26 @@ func resourceAwsServerlessApplicationRepositoryCloudFormationStack() *schema.Res } func resourceAwsServerlessApplicationRepositoryCloudFormationStackCreate(d *schema.ResourceData, meta interface{}) error { - serverlessConn := meta.(*AWSClient).serverlessapplicationrepositoryconn cfConn := meta.(*AWSClient).cfconn - stackName := d.Get("name").(string) - changeSetRequest := serverlessrepository.CreateCloudFormationChangeSetRequest{ - StackName: aws.String(stackName), - ApplicationId: aws.String(d.Get("application_id").(string)), - Capabilities: expandStringSet(d.Get("capabilities").(*schema.Set)), - Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreServerlessApplicationRepository().ServerlessapplicationrepositoryTags(), - } - if v, ok := d.GetOk("semantic_version"); ok { - version := v.(string) - changeSetRequest.SemanticVersion = aws.String(version) - } - if v, ok := d.GetOk("parameters"); ok { - changeSetRequest.ParameterOverrides = expandServerlessRepositoryCloudFormationChangeSetParameters(v.(map[string]interface{})) - } - - log.Printf("[DEBUG] Creating Serverless Application Repository change set: %s", changeSetRequest) - changeSetResponse, err := serverlessConn.CreateCloudFormationChangeSet(&changeSetRequest) + changeSet, err := createServerlessApplicationRepositoryCloudFormationChangeSet(d, meta.(*AWSClient)) if err != nil { - return fmt.Errorf("error creating Serverless Application Repository change set (%s): %w", stackName, err) + return fmt.Errorf("error creating Serverless Application Repository CloudFormation change set: %w", err) } - d.SetId(aws.StringValue(changeSetResponse.StackId)) - - _, err = cfwaiter.ChangeSetCreated(cfConn, d.Id(), aws.StringValue(changeSetResponse.ChangeSetId)) - if err != nil { - return fmt.Errorf("error waiting for Serverless Application Repository change set (%s) creation: %w", stackName, err) - } + log.Printf("[INFO] Serverless Application Repository CloudFormation Stack (%s) change set created", d.Id()) - log.Printf("[INFO] Serverless Application Repository change set (%s) created", d.Id()) + d.SetId(aws.StringValue(changeSet.StackId)) requestToken := resource.UniqueId() executeRequest := cloudformation.ExecuteChangeSetInput{ - ChangeSetName: changeSetResponse.ChangeSetId, + ChangeSetName: changeSet.ChangeSetId, ClientRequestToken: aws.String(requestToken), } - log.Printf("[DEBUG] Executing Serverless Application Repository change set: %s", executeRequest) + log.Printf("[DEBUG] Executing Serverless Application Repository CloudFormation change set: %s", executeRequest) _, err = cfConn.ExecuteChangeSet(&executeRequest) if err != nil { - return fmt.Errorf("Executing Serverless Application Repository change set failed: %w", err) + return fmt.Errorf("executing Serverless Application Repository CloudFormation Stack (%s) change set failed: %w", d.Id(), err) } _, err = cfwaiter.StackCreated(cfConn, d.Id(), requestToken, d.Timeout(schema.TimeoutCreate)) @@ -221,52 +197,27 @@ func flattenServerlessRepositoryParameterDefinitions(parameterDefinitions []*ser } func resourceAwsServerlessApplicationRepositoryCloudFormationStackUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).cfconn - - input := &cloudformation.CreateChangeSetInput{ - StackName: aws.String(d.Id()), - UsePreviousTemplate: aws.Bool(true), - ChangeSetType: aws.String("UPDATE"), - } - - input.ChangeSetName = aws.String(resource.PrefixedUniqueId(d.Get("name").(string))) - - // Parameters must be present whether they are changed or not - if v, ok := d.GetOk("parameters"); ok { - input.Parameters = expandCloudFormationParameters(v.(map[string]interface{})) - } - - if d.HasChange("tags") { - if v, ok := d.GetOk("tags"); ok { - input.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreServerlessApplicationRepository().CloudformationTags() - } - } - - input.Capabilities = expandServerlessRepositoryStackChangeSetCapabilities(d.Get("capabilities").(*schema.Set)) + cfConn := meta.(*AWSClient).cfconn - log.Printf("[DEBUG] Creating CloudFormation change set: %s", input) - changeSetResponse, err := conn.CreateChangeSet(input) + changeSet, err := createServerlessApplicationRepositoryCloudFormationChangeSet(d, meta.(*AWSClient)) if err != nil { - return fmt.Errorf("Creating CloudFormation change set failed: %w", err) + return fmt.Errorf("error creating Serverless Application Repository CloudFormation Stack (%s) change set: %w", d.Id(), err) } - _, err = cfwaiter.ChangeSetCreated(conn, d.Id(), aws.StringValue(changeSetResponse.Id)) - if err != nil { - return fmt.Errorf("error waiting for Serverless Application Repository change set (%s) creation: %w", d.Id(), err) - } + log.Printf("[INFO] Serverless Application Repository CloudFormation Stack (%s) change set created", d.Id()) requestToken := resource.UniqueId() executeRequest := cloudformation.ExecuteChangeSetInput{ - ChangeSetName: changeSetResponse.Id, + ChangeSetName: changeSet.ChangeSetId, ClientRequestToken: aws.String(requestToken), } - log.Printf("[DEBUG] Executing Serverless Application Repository change set: %s", executeRequest) - _, err = conn.ExecuteChangeSet(&executeRequest) + log.Printf("[DEBUG] Executing Serverless Application Repository CloudFormation change set: %s", executeRequest) + _, err = cfConn.ExecuteChangeSet(&executeRequest) if err != nil { - return fmt.Errorf("Executing Serverless Application Repository change set failed: %w", err) + return fmt.Errorf("executing Serverless Application Repository CloudFormation change set failed: %w", err) } - _, err = cfwaiter.StackUpdated(conn, d.Id(), requestToken, d.Timeout(schema.TimeoutUpdate)) + _, err = cfwaiter.StackUpdated(cfConn, d.Id(), requestToken, d.Timeout(schema.TimeoutUpdate)) if err != nil { return fmt.Errorf("error waiting for Serverless Application Repository CloudFormation Stack (%s) update: %w", d.Id(), err) } @@ -342,6 +293,33 @@ func resourceAwsServerlessApplicationRepositoryCloudFormationStackImport(d *sche return []*schema.ResourceData{d}, nil } +func createServerlessApplicationRepositoryCloudFormationChangeSet(d *schema.ResourceData, client *AWSClient) (*cloudformation.DescribeChangeSetOutput, error) { + serverlessConn := client.serverlessapplicationrepositoryconn + cfConn := client.cfconn + + stackName := d.Get("name").(string) + changeSetRequest := serverlessrepository.CreateCloudFormationChangeSetRequest{ + StackName: aws.String(stackName), + ApplicationId: aws.String(d.Get("application_id").(string)), + Capabilities: expandStringSet(d.Get("capabilities").(*schema.Set)), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreServerlessApplicationRepository().ServerlessapplicationrepositoryTags(), + } + if v, ok := d.GetOk("semantic_version"); ok { + changeSetRequest.SemanticVersion = aws.String(v.(string)) + } + if v, ok := d.GetOk("parameters"); ok { + changeSetRequest.ParameterOverrides = expandServerlessRepositoryCloudFormationChangeSetParameters(v.(map[string]interface{})) + } + + log.Printf("[DEBUG] Creating Serverless Application Repository CloudFormation change set: %s", changeSetRequest) + changeSetResponse, err := serverlessConn.CreateCloudFormationChangeSet(&changeSetRequest) + if err != nil { + return nil, err + } + + return cfwaiter.ChangeSetCreated(cfConn, aws.StringValue(changeSetResponse.StackId), aws.StringValue(changeSetResponse.ChangeSetId)) +} + func expandServerlessRepositoryCloudFormationChangeSetParameters(params map[string]interface{}) []*serverlessrepository.ParameterValue { var appParams []*serverlessrepository.ParameterValue for k, v := range params { @@ -365,15 +343,3 @@ func flattenServerlessRepositoryStackCapabilities(stackCapabilities []*string, a } return capabilities } - -func expandServerlessRepositoryStackChangeSetCapabilities(capabilities *schema.Set) []*string { - // Filter the capabilities for the CloudFormation Change Set. CloudFormation supports a - // subset of the capabilities supported by Serverless Application Repository. - result := make([]*string, 0, capabilities.Len()) - for _, c := range cloudformation.Capability_Values() { - if capabilities.Contains(c) { - result = append(result, aws.String(c)) - } - } - return result -} diff --git a/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack_test.go b/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack_test.go index 556eabb6158..db48a36a51c 100644 --- a/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack_test.go +++ b/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack_test.go @@ -15,7 +15,7 @@ import ( // Since aws_serverlessapplicationrepository_cloudformation_stack creates CloudFormation stacks, // the aws_cloudformation_stack sweeper will clean these up as well. -func TestAccAwsServerlessRepositoryStack_basic(t *testing.T) { +func TestAccAwsServerlessApplicationRepositoryCloudFormationStack_basic(t *testing.T) { var stack cloudformation.Stack stackName := acctest.RandomWithPrefix("tf-acc-test") @@ -27,9 +27,9 @@ func TestAccAwsServerlessRepositoryStack_basic(t *testing.T) { CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsServerlessRepositoryStackConfig(stackName), + Config: testAccAwsServerlessApplicationRepositoryCloudFormationStackConfig(stackName), Check: resource.ComposeTestCheckFunc( - testAccCheckServerlessRepositoryStackExists(resourceName, &stack), + testAccCheckServerlessApplicationRepositoryCloudFormationStackExists(resourceName, &stack), resource.TestCheckResourceAttr(resourceName, "name", stackName), testAccCheckResourceAttrRegionalARNIgnoreRegionAndAccount(resourceName, "application_id", "serverlessrepo", "applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), resource.TestCheckResourceAttrSet(resourceName, "semantic_version"), @@ -51,13 +51,13 @@ func TestAccAwsServerlessRepositoryStack_basic(t *testing.T) { }, { ResourceName: resourceName, - ImportStateIdFunc: testAccAwsServerlessRepositoryStackNameImportStateIdFunc(resourceName), + ImportStateIdFunc: testAccAwsServerlessApplicationRepositoryCloudFormationStackNameImportStateIdFunc(resourceName), ImportState: true, ImportStateVerify: true, }, { ResourceName: resourceName, - ImportStateIdFunc: testAccAwsServerlessRepositoryStackNameNoPrefixImportStateIdFunc(resourceName), + ImportStateIdFunc: testAccAwsServerlessApplicationRepositoryCloudFormationStackNameNoPrefixImportStateIdFunc(resourceName), ImportState: true, ImportStateVerify: true, }, @@ -65,7 +65,7 @@ func TestAccAwsServerlessRepositoryStack_basic(t *testing.T) { }) } -func TestAccAwsServerlessRepositoryStack_disappears(t *testing.T) { +func TestAccAwsServerlessApplicationRepositoryCloudFormationStack_disappears(t *testing.T) { var stack cloudformation.Stack stackName := acctest.RandomWithPrefix("tf-acc-test") @@ -77,9 +77,9 @@ func TestAccAwsServerlessRepositoryStack_disappears(t *testing.T) { CheckDestroy: testAccCheckAmiDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsServerlessRepositoryStackConfig(stackName), + Config: testAccAwsServerlessApplicationRepositoryCloudFormationStackConfig(stackName), Check: resource.ComposeTestCheckFunc( - testAccCheckServerlessRepositoryStackExists(resourceName, &stack), + testAccCheckServerlessApplicationRepositoryCloudFormationStackExists(resourceName, &stack), testAccCheckResourceDisappears(testAccProvider, resourceAwsServerlessApplicationRepositoryCloudFormationStack(), resourceName), ), ExpectNonEmptyPlan: true, @@ -88,8 +88,8 @@ func TestAccAwsServerlessRepositoryStack_disappears(t *testing.T) { }) } -func TestAccAwsServerlessRepositoryStack_versioned(t *testing.T) { - var stack cloudformation.Stack +func TestAccAwsServerlessApplicationRepositoryCloudFormationStack_versioned(t *testing.T) { + var stack1, stack2, stack3 cloudformation.Stack stackName := acctest.RandomWithPrefix("tf-acc-test") const ( @@ -105,9 +105,9 @@ func TestAccAwsServerlessRepositoryStack_versioned(t *testing.T) { CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSServerlessRepositoryStackConfig_versioned(stackName, version1), + Config: testAccAWSServerlessApplicationRepositoryCloudFormationStackConfig_versioned(stackName, version1), Check: resource.ComposeTestCheckFunc( - testAccCheckServerlessRepositoryStackExists(resourceName, &stack), + testAccCheckServerlessApplicationRepositoryCloudFormationStackExists(resourceName, &stack1), resource.TestCheckResourceAttr(resourceName, "semantic_version", version1), resource.TestCheckResourceAttr(resourceName, "capabilities.#", "1"), tfawsresource.TestCheckTypeSetElemAttr(resourceName, "capabilities.*", "CAPABILITY_IAM"), @@ -119,9 +119,10 @@ func TestAccAwsServerlessRepositoryStack_versioned(t *testing.T) { ImportStateVerify: true, }, { - Config: testAccAWSServerlessRepositoryStackConfig_versioned2(stackName, version2), + Config: testAccAWSServerlessApplicationRepositoryCloudFormationStackConfig_versioned2(stackName, version2), Check: resource.ComposeTestCheckFunc( - testAccCheckServerlessRepositoryStackExists(resourceName, &stack), + testAccCheckServerlessApplicationRepositoryCloudFormationStackExists(resourceName, &stack2), + testAccCheckCloudFormationStackNotRecreated(&stack1, &stack2), resource.TestCheckResourceAttr(resourceName, "semantic_version", version2), resource.TestCheckResourceAttr(resourceName, "capabilities.#", "2"), tfawsresource.TestCheckTypeSetElemAttr(resourceName, "capabilities.*", "CAPABILITY_IAM"), @@ -130,9 +131,10 @@ func TestAccAwsServerlessRepositoryStack_versioned(t *testing.T) { }, { // Confirm removal of "CAPABILITY_RESOURCE_POLICY" is handled properly - Config: testAccAWSServerlessRepositoryStackConfig_versioned(stackName, version1), + Config: testAccAWSServerlessApplicationRepositoryCloudFormationStackConfig_versioned(stackName, version1), Check: resource.ComposeTestCheckFunc( - testAccCheckServerlessRepositoryStackExists(resourceName, &stack), + testAccCheckServerlessApplicationRepositoryCloudFormationStackExists(resourceName, &stack3), + testAccCheckCloudFormationStackNotRecreated(&stack2, &stack3), resource.TestCheckResourceAttr(resourceName, "semantic_version", version1), resource.TestCheckResourceAttr(resourceName, "capabilities.#", "1"), tfawsresource.TestCheckTypeSetElemAttr(resourceName, "capabilities.*", "CAPABILITY_IAM"), @@ -142,7 +144,7 @@ func TestAccAwsServerlessRepositoryStack_versioned(t *testing.T) { }) } -func TestAccAwsServerlessRepositoryStack_paired(t *testing.T) { +func TestAccAwsServerlessApplicationRepositoryCloudFormationStack_paired(t *testing.T) { var stack cloudformation.Stack stackName := acctest.RandomWithPrefix("tf-acc-test") @@ -156,9 +158,9 @@ func TestAccAwsServerlessRepositoryStack_paired(t *testing.T) { CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSServerlessRepositoryStackConfig_versionedPaired(stackName, version), + Config: testAccAWSServerlessApplicationRepositoryCloudFormationStackConfig_versionedPaired(stackName, version), Check: resource.ComposeTestCheckFunc( - testAccCheckServerlessRepositoryStackExists(resourceName, &stack), + testAccCheckServerlessApplicationRepositoryCloudFormationStackExists(resourceName, &stack), resource.TestCheckResourceAttr(resourceName, "semantic_version", version), resource.TestCheckResourceAttr(resourceName, "capabilities.#", "2"), tfawsresource.TestCheckTypeSetElemAttr(resourceName, "capabilities.*", "CAPABILITY_IAM"), @@ -169,7 +171,7 @@ func TestAccAwsServerlessRepositoryStack_paired(t *testing.T) { }) } -func TestAccAwsServerlessRepositoryStack_Tags(t *testing.T) { +func TestAccAwsServerlessApplicationRepositoryCloudFormationStack_Tags(t *testing.T) { var stack cloudformation.Stack stackName := acctest.RandomWithPrefix("tf-acc-test") @@ -181,9 +183,9 @@ func TestAccAwsServerlessRepositoryStack_Tags(t *testing.T) { CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsServerlessRepositoryStackConfigTags1(stackName, "key1", "value1"), + Config: testAccAwsServerlessApplicationRepositoryCloudFormationStackConfigTags1(stackName, "key1", "value1"), Check: resource.ComposeTestCheckFunc( - testAccCheckServerlessRepositoryStackExists(resourceName, &stack), + testAccCheckServerlessApplicationRepositoryCloudFormationStackExists(resourceName, &stack), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), ), @@ -194,17 +196,17 @@ func TestAccAwsServerlessRepositoryStack_Tags(t *testing.T) { ImportStateVerify: true, }, { - Config: testAccAwsServerlessRepositoryStackConfigTags2(stackName, "key1", "value1updated", "key2", "value2"), + Config: testAccAwsServerlessApplicationRepositoryCloudFormationStackConfigTags2(stackName, "key1", "value1updated", "key2", "value2"), Check: resource.ComposeTestCheckFunc( - testAccCheckServerlessRepositoryStackExists(resourceName, &stack), + testAccCheckServerlessApplicationRepositoryCloudFormationStackExists(resourceName, &stack), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, { - Config: testAccAwsServerlessRepositoryStackConfigTags1(stackName, "key2", "value2"), + Config: testAccAwsServerlessApplicationRepositoryCloudFormationStackConfigTags1(stackName, "key2", "value2"), Check: resource.ComposeTestCheckFunc( - testAccCheckServerlessRepositoryStackExists(resourceName, &stack), + testAccCheckServerlessApplicationRepositoryCloudFormationStackExists(resourceName, &stack), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), @@ -213,7 +215,7 @@ func TestAccAwsServerlessRepositoryStack_Tags(t *testing.T) { }) } -func TestAccAwsServerlessRepositoryStack_update(t *testing.T) { +func TestAccAwsServerlessApplicationRepositoryCloudFormationStack_update(t *testing.T) { var stack cloudformation.Stack stackName := acctest.RandomWithPrefix("tf-acc-test") initialName := acctest.RandomWithPrefix("FuncName1") @@ -227,9 +229,9 @@ func TestAccAwsServerlessRepositoryStack_update(t *testing.T) { CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSServerlessRepositoryStackConfig_updateInitial(stackName, initialName), + Config: testAccAWSServerlessApplicationRepositoryCloudFormationStackConfig_updateInitial(stackName, initialName), Check: resource.ComposeTestCheckFunc( - testAccCheckServerlessRepositoryStackExists(resourceName, &stack), + testAccCheckServerlessApplicationRepositoryCloudFormationStackExists(resourceName, &stack), testAccCheckResourceAttrRegionalARNIgnoreRegionAndAccount(resourceName, "application_id", "serverlessrepo", "applications/SecretsManagerRDSPostgreSQLRotationSingleUser"), resource.TestCheckResourceAttr(resourceName, "parameters.functionName", initialName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -237,9 +239,9 @@ func TestAccAwsServerlessRepositoryStack_update(t *testing.T) { ), }, { - Config: testAccAWSServerlessRepositoryStackConfig_updateUpdated(stackName, updatedName), + Config: testAccAWSServerlessApplicationRepositoryCloudFormationStackConfig_updateUpdated(stackName, updatedName), Check: resource.ComposeTestCheckFunc( - testAccCheckServerlessRepositoryStackExists(resourceName, &stack), + testAccCheckServerlessApplicationRepositoryCloudFormationStackExists(resourceName, &stack), resource.TestCheckResourceAttr(resourceName, "parameters.functionName", updatedName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key", "value"), @@ -249,7 +251,7 @@ func TestAccAwsServerlessRepositoryStack_update(t *testing.T) { }) } -func testAccCheckServerlessRepositoryStackExists(n string, stack *cloudformation.Stack) resource.TestCheckFunc { +func testAccCheckServerlessApplicationRepositoryCloudFormationStackExists(n string, stack *cloudformation.Stack) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -274,7 +276,7 @@ func testAccCheckServerlessRepositoryStackExists(n string, stack *cloudformation } } -func testAccAwsServerlessRepositoryStackNameImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { +func testAccAwsServerlessApplicationRepositoryCloudFormationStackNameImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { return func(s *terraform.State) (string, error) { rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -285,7 +287,7 @@ func testAccAwsServerlessRepositoryStackNameImportStateIdFunc(resourceName strin } } -func testAccAwsServerlessRepositoryStackNameNoPrefixImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { +func testAccAwsServerlessApplicationRepositoryCloudFormationStackNameNoPrefixImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { return func(s *terraform.State) (string, error) { rs, ok := s.RootModule().Resources[resourceName] if !ok { @@ -296,9 +298,9 @@ func testAccAwsServerlessRepositoryStackNameNoPrefixImportStateIdFunc(resourceNa } } -func testAccAwsServerlessRepositoryStackConfig(stackName string) string { +func testAccAwsServerlessApplicationRepositoryCloudFormationStackConfig(stackName string) string { return composeConfig( - testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication, + testAccCheckAwsServerlessApplicationRepositoryPostgresSingleUserRotatorApplication, fmt.Sprintf(` resource "aws_serverlessapplicationrepository_cloudformation_stack" "postgres-rotator" { name = "%[1]s" @@ -317,9 +319,9 @@ data "aws_region" "current" {} `, stackName)) } -func testAccAWSServerlessRepositoryStackConfig_updateInitial(stackName, functionName string) string { +func testAccAWSServerlessApplicationRepositoryCloudFormationStackConfig_updateInitial(stackName, functionName string) string { return composeConfig( - testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication, + testAccCheckAwsServerlessApplicationRepositoryPostgresSingleUserRotatorApplication, fmt.Sprintf(` resource "aws_serverlessapplicationrepository_cloudformation_stack" "postgres-rotator" { name = "%[1]s" @@ -341,9 +343,9 @@ data "aws_region" "current" {} `, stackName, functionName)) } -func testAccAWSServerlessRepositoryStackConfig_updateUpdated(stackName, functionName string) string { +func testAccAWSServerlessApplicationRepositoryCloudFormationStackConfig_updateUpdated(stackName, functionName string) string { return composeConfig( - testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication, + testAccCheckAwsServerlessApplicationRepositoryPostgresSingleUserRotatorApplication, fmt.Sprintf(` resource "aws_serverlessapplicationrepository_cloudformation_stack" "postgres-rotator" { name = "%[1]s" @@ -365,14 +367,17 @@ data "aws_region" "current" {} `, stackName, functionName)) } -func testAccAWSServerlessRepositoryStackConfig_versioned(stackName, version string) string { +func testAccAWSServerlessApplicationRepositoryCloudFormationStackConfig_versioned(stackName, version string) string { return composeConfig( - testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication, + testAccCheckAwsServerlessApplicationRepositoryPostgresSingleUserRotatorApplication, fmt.Sprintf(` resource "aws_serverlessapplicationrepository_cloudformation_stack" "postgres-rotator" { name = "%[1]s" application_id = local.postgres_single_user_rotator_arn semantic_version = "%[2]s" + capabilities = [ + "CAPABILITY_IAM", + ] parameters = { functionName = "func-%[1]s" endpoint = "secretsmanager.${data.aws_region.current.name}.${data.aws_partition.current.dns_suffix}" @@ -383,9 +388,9 @@ data "aws_region" "current" {} `, stackName, version)) } -func testAccAWSServerlessRepositoryStackConfig_versioned2(stackName, version string) string { +func testAccAWSServerlessApplicationRepositoryCloudFormationStackConfig_versioned2(stackName, version string) string { return composeConfig( - testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication, + testAccCheckAwsServerlessApplicationRepositoryPostgresSingleUserRotatorApplication, fmt.Sprintf(` resource "aws_serverlessapplicationrepository_cloudformation_stack" "postgres-rotator" { name = "%[1]s" @@ -405,9 +410,9 @@ data "aws_region" "current" {} `, stackName, version)) } -func testAccAWSServerlessRepositoryStackConfig_versionedPaired(stackName, version string) string { +func testAccAWSServerlessApplicationRepositoryCloudFormationStackConfig_versionedPaired(stackName, version string) string { return composeConfig( - testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication, + testAccCheckAwsServerlessApplicationRepositoryPostgresSingleUserRotatorApplication, fmt.Sprintf(` resource "aws_serverlessapplicationrepository_cloudformation_stack" "postgres-rotator" { name = "%[1]s" @@ -429,9 +434,9 @@ data "aws_region" "current" {} `, stackName, version)) } -func testAccAwsServerlessRepositoryStackConfigTags1(rName, tagKey1, tagValue1 string) string { +func testAccAwsServerlessApplicationRepositoryCloudFormationStackConfigTags1(rName, tagKey1, tagValue1 string) string { return composeConfig( - testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication, + testAccCheckAwsServerlessApplicationRepositoryPostgresSingleUserRotatorApplication, fmt.Sprintf(` resource "aws_serverlessapplicationrepository_cloudformation_stack" "postgres-rotator" { name = "%[1]s" @@ -453,9 +458,9 @@ data "aws_region" "current" {} `, rName, tagKey1, tagValue1)) } -func testAccAwsServerlessRepositoryStackConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { +func testAccAwsServerlessApplicationRepositoryCloudFormationStackConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { return composeConfig( - testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication, + testAccCheckAwsServerlessApplicationRepositoryPostgresSingleUserRotatorApplication, fmt.Sprintf(` resource "aws_serverlessapplicationrepository_cloudformation_stack" "postgres-rotator" { name = "%[1]s" @@ -478,7 +483,7 @@ data "aws_region" "current" {} `, rName, tagKey1, tagValue1, tagKey2, tagValue2)) } -const testAccCheckAwsServerlessRepositoryPostgresSingleUserRotatorApplication = ` +const testAccCheckAwsServerlessApplicationRepositoryPostgresSingleUserRotatorApplication = ` data "aws_partition" "current" {} locals { diff --git a/website/docs/r/serverlessapplicationrepository_cloudformation_stack.html.markdown b/website/docs/r/serverlessapplicationrepository_cloudformation_stack.html.markdown index 9652fb8d718..ea5a0c644a3 100644 --- a/website/docs/r/serverlessapplicationrepository_cloudformation_stack.html.markdown +++ b/website/docs/r/serverlessapplicationrepository_cloudformation_stack.html.markdown @@ -36,8 +36,7 @@ The following arguments are supported: * `name` - (Required) The name of the stack to create. The resource deployed in AWS will be prefixed with `serverlessrepo-` * `application_id` - (Required) The ARN of the application from the Serverless Application Repository. -* `capabilities` - A list of capabilities. - Valid values: `CAPABILITY_IAM`, `CAPABILITY_NAMED_IAM`, `CAPABILITY_RESOURCE_POLICY`, or `CAPABILITY_AUTO_EXPAND` +* `capabilities` - (Required) A list of capabilities. Valid values are `CAPABILITY_IAM`, `CAPABILITY_NAMED_IAM`, `CAPABILITY_RESOURCE_POLICY`, or `CAPABILITY_AUTO_EXPAND` * `parameters` - (Optional) A map of Parameter structures that specify input parameters for the stack. * `semantic_version` - (Optional) The version of the application to deploy. If not supplied, deploys the latest version. * `tags` - (Optional) A list of tags to associate with this stack. From 69a0677ba591d50ff0d3840a16f5a50ec18ec7d6 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 24 Nov 2020 16:22:33 -0800 Subject: [PATCH 40/42] Updates tfresource.NotFound() to support wrapped errors --- aws/internal/tfresource/errors.go | 9 ++++++--- aws/internal/tfresource/errors_test.go | 5 +++-- ...rverlessapplicationrepository_cloudformation_stack.go | 5 ++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/aws/internal/tfresource/errors.go b/aws/internal/tfresource/errors.go index 13bcee15b3e..ae1d006ff84 100644 --- a/aws/internal/tfresource/errors.go +++ b/aws/internal/tfresource/errors.go @@ -1,14 +1,17 @@ package tfresource import ( + "errors" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) // NotFound returns true if the error represents a "resource not found" condition. -// Specifically, NotFound returns true if the error is of type resource.NotFoundError. +// Specifically, NotFound returns true if the error or a wrapped error is of type +// resource.NotFoundError. func NotFound(err error) bool { - _, ok := err.(*resource.NotFoundError) - return ok + var e *resource.NotFoundError + return errors.As(err, &e) } // TimedOut returns true if the error represents a "wait timed out" condition. diff --git a/aws/internal/tfresource/errors_test.go b/aws/internal/tfresource/errors_test.go index e04c486c1d8..175ef5150cd 100644 --- a/aws/internal/tfresource/errors_test.go +++ b/aws/internal/tfresource/errors_test.go @@ -32,8 +32,9 @@ func TestNotFound(t *testing.T) { Err: fmt.Errorf("test: %w", errors.New("test")), }, { - Name: "wrapped not found error", - Err: fmt.Errorf("test: %w", &resource.NotFoundError{LastError: errors.New("test")}), + Name: "wrapped not found error", + Err: fmt.Errorf("test: %w", &resource.NotFoundError{LastError: errors.New("test")}), + Expected: true, }, } diff --git a/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go b/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go index 9d4196db89d..48e22bc5488 100644 --- a/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go +++ b/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go @@ -1,7 +1,6 @@ package aws import ( - "errors" "fmt" "log" "strings" @@ -19,6 +18,7 @@ import ( cfwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/cloudformation/waiter" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/serverlessapplicationrepository/finder" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/serverlessapplicationrepository/waiter" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) const serverlessApplicationRepositoryCloudFormationStackNamePrefix = "serverlessrepo-" @@ -142,8 +142,7 @@ func resourceAwsServerlessApplicationRepositoryCloudFormationStackRead(d *schema parameterDefinitions := flattenServerlessRepositoryParameterDefinitions(version.ParameterDefinitions) stack, err := cffinder.Stack(cfConn, d.Id()) - var e *resource.NotFoundError - if errors.As(err, &e) { + if tfresource.NotFound(err) { log.Printf("[WARN] CloudFormation stack (%s) not found, removing from state", d.Id()) d.SetId("") return nil From 167791bf149031187639ddaade005fc08f2a1a39 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 25 Nov 2020 11:33:28 -0800 Subject: [PATCH 41/42] Reorganizes import and read code --- ...licationrepository_cloudformation_stack.go | 88 +++++++++---------- 1 file changed, 40 insertions(+), 48 deletions(-) diff --git a/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go b/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go index 48e22bc5488..998db6a1fa9 100644 --- a/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go +++ b/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack.go @@ -21,7 +21,12 @@ import ( "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) -const serverlessApplicationRepositoryCloudFormationStackNamePrefix = "serverlessrepo-" +const ( + serverlessApplicationRepositoryCloudFormationStackNamePrefix = "serverlessrepo-" + + serverlessApplicationRepositoryCloudFormationStackTagApplicationID = "serverlessrepo:applicationId" + serverlessApplicationRepositoryCloudFormationStackTagSemanticVersion = "serverlessrepo:semanticVersion" +) func resourceAwsServerlessApplicationRepositoryCloudFormationStack() *schema.Resource { return &schema.Resource{ @@ -120,47 +125,36 @@ func resourceAwsServerlessApplicationRepositoryCloudFormationStackRead(d *schema cfConn := meta.(*AWSClient).cfconn ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig - applicationID := d.Get("application_id").(string) - semanticVersion := d.Get("semantic_version").(string) - descriptor := applicationID - if semanticVersion != "" { - descriptor += fmt.Sprintf(", version %s", semanticVersion) - } - - getApplicationOutput, err := finder.Application(serverlessConn, applicationID, semanticVersion) - if err != nil { - return fmt.Errorf("error getting Serverless Application Repository application (%s): %w", descriptor, err) - } - - if getApplicationOutput.Version == nil { - return fmt.Errorf("error getting Serverless Application Repository application (%s): returned empty version record", descriptor) - } - - version := getApplicationOutput.Version - d.Set("semantic_version", version.SemanticVersion) - - parameterDefinitions := flattenServerlessRepositoryParameterDefinitions(version.ParameterDefinitions) - stack, err := cffinder.Stack(cfConn, d.Id()) if tfresource.NotFound(err) { - log.Printf("[WARN] CloudFormation stack (%s) not found, removing from state", d.Id()) + log.Printf("[WARN] Serverless Application Repository CloudFormation Stack (%s) not found, removing from state", d.Id()) d.SetId("") return nil } if err != nil { - return fmt.Errorf("error describing CloudFormation Stack (%s): %w", d.Id(), err) + return fmt.Errorf("error describing Serverless Application Repository CloudFormation Stack (%s): %w", d.Id(), err) } - // Serverless Application Repo prefixes the stack name with "serverlessrepo-", - // so remove it from the saved string + // Serverless Application Repo prefixes the stack name with "serverlessrepo-", so remove it from the saved string stackName := strings.TrimPrefix(aws.StringValue(stack.StackName), serverlessApplicationRepositoryCloudFormationStackNamePrefix) d.Set("name", &stackName) - if err = d.Set("parameters", flattenNonDefaultServerlessApplicationCloudFormationParameters(stack.Parameters, parameterDefinitions)); err != nil { - return fmt.Errorf("failed to set parameters: %w", err) + tags := keyvaluetags.CloudformationKeyValueTags(stack.Tags) + var applicationID, semanticVersion string + if v, ok := tags[serverlessApplicationRepositoryCloudFormationStackTagApplicationID]; ok { + applicationID = aws.StringValue(v.Value) + d.Set("application_id", applicationID) + } else { + return fmt.Errorf("error describing Serverless Application Repository CloudFormation Stack (%s): missing required tag \"%s\"", d.Id(), serverlessApplicationRepositoryCloudFormationStackTagApplicationID) + } + if v, ok := tags[serverlessApplicationRepositoryCloudFormationStackTagSemanticVersion]; ok { + semanticVersion = aws.StringValue(v.Value) + d.Set("semantic_version", semanticVersion) + } else { + return fmt.Errorf("error describing Serverless Application Repository CloudFormation Stack (%s): missing required tag \"%s\"", d.Id(), serverlessApplicationRepositoryCloudFormationStackTagSemanticVersion) } - if err = d.Set("tags", keyvaluetags.CloudformationKeyValueTags(stack.Tags).IgnoreServerlessApplicationRepository().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { + if err = d.Set("tags", tags.IgnoreServerlessApplicationRepository().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { return fmt.Errorf("failed to set tags: %w", err) } @@ -168,6 +162,21 @@ func resourceAwsServerlessApplicationRepositoryCloudFormationStackRead(d *schema return fmt.Errorf("failed to set outputs: %w", err) } + getApplicationOutput, err := finder.Application(serverlessConn, applicationID, semanticVersion) + if err != nil { + return fmt.Errorf("error getting Serverless Application Repository application (%s, v%s): %w", applicationID, semanticVersion, err) + } + + if getApplicationOutput == nil || getApplicationOutput.Version == nil { + return fmt.Errorf("error getting Serverless Application Repository application (%s, v%s): empty response", applicationID, semanticVersion) + } + + version := getApplicationOutput.Version + + if err = d.Set("parameters", flattenNonDefaultServerlessApplicationCloudFormationParameters(stack.Parameters, version.ParameterDefinitions)); err != nil { + return fmt.Errorf("failed to set parameters: %w", err) + } + if err = d.Set("capabilities", flattenServerlessRepositoryStackCapabilities(stack.Capabilities, version.RequiredCapabilities)); err != nil { return fmt.Errorf("failed to set capabilities: %w", err) } @@ -175,7 +184,8 @@ func resourceAwsServerlessApplicationRepositoryCloudFormationStackRead(d *schema return nil } -func flattenNonDefaultServerlessApplicationCloudFormationParameters(cfParams []*cloudformation.Parameter, parameterDefinitions map[string]*serverlessrepository.ParameterDefinition) map[string]interface{} { +func flattenNonDefaultServerlessApplicationCloudFormationParameters(cfParams []*cloudformation.Parameter, rawParameterDefinitions []*serverlessrepository.ParameterDefinition) map[string]interface{} { + parameterDefinitions := flattenServerlessRepositoryParameterDefinitions(rawParameterDefinitions) params := make(map[string]interface{}, len(cfParams)) for _, p := range cfParams { key := aws.StringValue(p.ParameterKey) @@ -269,25 +279,7 @@ func resourceAwsServerlessApplicationRepositoryCloudFormationStackImport(d *sche return nil, fmt.Errorf("error describing Serverless Application Repository CloudFormation Stack (%s): %w", stackID, err) } - tags := stack.Tags - var applicationID, semanticVersion string - for _, tag := range tags { - if aws.StringValue(tag.Key) == "serverlessrepo:applicationId" { - applicationID = aws.StringValue(tag.Value) - } else if aws.StringValue(tag.Key) == "serverlessrepo:semanticVersion" { - semanticVersion = aws.StringValue(tag.Value) - } - if applicationID != "" && semanticVersion != "" { - break - } - } - if applicationID == "" || semanticVersion == "" { - return nil, fmt.Errorf("cannot import Serverless Application Repository CloudFormation Stack (%s): tags \"serverlessrepo:applicationId\" and \"serverlessrepo:semanticVersion\" must be defined", stackID) - } - d.SetId(aws.StringValue(stack.StackId)) - d.Set("application_id", applicationID) - d.Set("semantic_version", semanticVersion) return []*schema.ResourceData{d}, nil } From 19b88f7bd1d9d2c5209640a5509abafce1f867cd Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 25 Nov 2020 11:45:21 -0800 Subject: [PATCH 42/42] Avoids Go formatting churn and Git conflict --- aws/provider.go | 1697 ++++++++++++++++++++++++----------------------- 1 file changed, 850 insertions(+), 847 deletions(-) diff --git a/aws/provider.go b/aws/provider.go index 614036ca6a4..8c53f259076 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -165,222 +165,221 @@ func Provider() *schema.Provider { }, DataSourcesMap: map[string]*schema.Resource{ - "aws_acm_certificate": dataSourceAwsAcmCertificate(), - "aws_acmpca_certificate_authority": dataSourceAwsAcmpcaCertificateAuthority(), - "aws_ami": dataSourceAwsAmi(), - "aws_ami_ids": dataSourceAwsAmiIds(), - "aws_api_gateway_api_key": dataSourceAwsApiGatewayApiKey(), - "aws_api_gateway_resource": dataSourceAwsApiGatewayResource(), - "aws_api_gateway_rest_api": dataSourceAwsApiGatewayRestApi(), - "aws_api_gateway_vpc_link": dataSourceAwsApiGatewayVpcLink(), - "aws_arn": dataSourceAwsArn(), - "aws_autoscaling_group": dataSourceAwsAutoscalingGroup(), - "aws_autoscaling_groups": dataSourceAwsAutoscalingGroups(), - "aws_availability_zone": dataSourceAwsAvailabilityZone(), - "aws_availability_zones": dataSourceAwsAvailabilityZones(), - "aws_backup_plan": dataSourceAwsBackupPlan(), - "aws_backup_selection": dataSourceAwsBackupSelection(), - "aws_backup_vault": dataSourceAwsBackupVault(), - "aws_batch_compute_environment": dataSourceAwsBatchComputeEnvironment(), - "aws_batch_job_queue": dataSourceAwsBatchJobQueue(), - "aws_billing_service_account": dataSourceAwsBillingServiceAccount(), - "aws_caller_identity": dataSourceAwsCallerIdentity(), - "aws_canonical_user_id": dataSourceAwsCanonicalUserId(), - "aws_cloudformation_export": dataSourceAwsCloudFormationExport(), - "aws_cloudformation_stack": dataSourceAwsCloudFormationStack(), - "aws_cloudfront_distribution": dataSourceAwsCloudFrontDistribution(), - "aws_cloudhsm_v2_cluster": dataSourceCloudHsmV2Cluster(), - "aws_cloudtrail_service_account": dataSourceAwsCloudTrailServiceAccount(), - "aws_cloudwatch_log_group": dataSourceAwsCloudwatchLogGroup(), - "aws_codeartifact_authorization_token": dataSourceAwsCodeArtifactAuthorizationToken(), - "aws_codeartifact_repository_endpoint": dataSourceAwsCodeArtifactRepositoryEndpoint(), - "aws_cognito_user_pools": dataSourceAwsCognitoUserPools(), - "aws_codecommit_repository": dataSourceAwsCodeCommitRepository(), - "aws_cur_report_definition": dataSourceAwsCurReportDefinition(), - "aws_db_cluster_snapshot": dataSourceAwsDbClusterSnapshot(), - "aws_db_event_categories": dataSourceAwsDbEventCategories(), - "aws_db_instance": dataSourceAwsDbInstance(), - "aws_db_snapshot": dataSourceAwsDbSnapshot(), - "aws_db_subnet_group": dataSourceAwsDbSubnetGroup(), - "aws_directory_service_directory": dataSourceAwsDirectoryServiceDirectory(), - "aws_docdb_engine_version": dataSourceAwsDocdbEngineVersion(), - "aws_docdb_orderable_db_instance": dataSourceAwsDocdbOrderableDbInstance(), - "aws_dx_gateway": dataSourceAwsDxGateway(), - "aws_dynamodb_table": dataSourceAwsDynamoDbTable(), - "aws_ebs_default_kms_key": dataSourceAwsEbsDefaultKmsKey(), - "aws_ebs_encryption_by_default": dataSourceAwsEbsEncryptionByDefault(), - "aws_ebs_snapshot": dataSourceAwsEbsSnapshot(), - "aws_ebs_snapshot_ids": dataSourceAwsEbsSnapshotIds(), - "aws_ebs_volume": dataSourceAwsEbsVolume(), - "aws_ebs_volumes": dataSourceAwsEbsVolumes(), - "aws_ec2_coip_pool": dataSourceAwsEc2CoipPool(), - "aws_ec2_coip_pools": dataSourceAwsEc2CoipPools(), - "aws_ec2_instance_type": dataSourceAwsEc2InstanceType(), - "aws_ec2_instance_type_offering": dataSourceAwsEc2InstanceTypeOffering(), - "aws_ec2_instance_type_offerings": dataSourceAwsEc2InstanceTypeOfferings(), - "aws_ec2_local_gateway": dataSourceAwsEc2LocalGateway(), - "aws_ec2_local_gateways": dataSourceAwsEc2LocalGateways(), - "aws_ec2_local_gateway_route_table": dataSourceAwsEc2LocalGatewayRouteTable(), - "aws_ec2_local_gateway_route_tables": dataSourceAwsEc2LocalGatewayRouteTables(), - "aws_ec2_local_gateway_virtual_interface": dataSourceAwsEc2LocalGatewayVirtualInterface(), - "aws_ec2_local_gateway_virtual_interface_group": dataSourceAwsEc2LocalGatewayVirtualInterfaceGroup(), - "aws_ec2_local_gateway_virtual_interface_groups": dataSourceAwsEc2LocalGatewayVirtualInterfaceGroups(), - "aws_ec2_spot_price": dataSourceAwsEc2SpotPrice(), - "aws_ec2_transit_gateway": dataSourceAwsEc2TransitGateway(), - "aws_ec2_transit_gateway_dx_gateway_attachment": dataSourceAwsEc2TransitGatewayDxGatewayAttachment(), - "aws_ec2_transit_gateway_peering_attachment": dataSourceAwsEc2TransitGatewayPeeringAttachment(), - "aws_ec2_transit_gateway_route_table": dataSourceAwsEc2TransitGatewayRouteTable(), - "aws_ec2_transit_gateway_vpc_attachment": dataSourceAwsEc2TransitGatewayVpcAttachment(), - "aws_ec2_transit_gateway_vpn_attachment": dataSourceAwsEc2TransitGatewayVpnAttachment(), - "aws_ecr_authorization_token": dataSourceAwsEcrAuthorizationToken(), - "aws_ecr_image": dataSourceAwsEcrImage(), - "aws_ecr_repository": dataSourceAwsEcrRepository(), - "aws_ecs_cluster": dataSourceAwsEcsCluster(), - "aws_ecs_container_definition": dataSourceAwsEcsContainerDefinition(), - "aws_ecs_service": dataSourceAwsEcsService(), - "aws_ecs_task_definition": dataSourceAwsEcsTaskDefinition(), - "aws_customer_gateway": dataSourceAwsCustomerGateway(), - "aws_efs_access_point": dataSourceAwsEfsAccessPoint(), - "aws_efs_access_points": dataSourceAwsEfsAccessPoints(), - "aws_efs_file_system": dataSourceAwsEfsFileSystem(), - "aws_efs_mount_target": dataSourceAwsEfsMountTarget(), - "aws_eip": dataSourceAwsEip(), - "aws_eks_cluster": dataSourceAwsEksCluster(), - "aws_eks_cluster_auth": dataSourceAwsEksClusterAuth(), - "aws_elastic_beanstalk_application": dataSourceAwsElasticBeanstalkApplication(), - "aws_elastic_beanstalk_hosted_zone": dataSourceAwsElasticBeanstalkHostedZone(), - "aws_elastic_beanstalk_solution_stack": dataSourceAwsElasticBeanstalkSolutionStack(), - "aws_elasticache_cluster": dataSourceAwsElastiCacheCluster(), - "aws_elasticsearch_domain": dataSourceAwsElasticSearchDomain(), - "aws_elb": dataSourceAwsElb(), - "aws_elasticache_replication_group": dataSourceAwsElasticacheReplicationGroup(), - "aws_elb_hosted_zone_id": dataSourceAwsElbHostedZoneId(), - "aws_elb_service_account": dataSourceAwsElbServiceAccount(), - "aws_glue_script": dataSourceAwsGlueScript(), - "aws_guardduty_detector": dataSourceAwsGuarddutyDetector(), - "aws_iam_account_alias": dataSourceAwsIamAccountAlias(), - "aws_iam_group": dataSourceAwsIAMGroup(), - "aws_iam_instance_profile": dataSourceAwsIAMInstanceProfile(), - "aws_iam_policy": dataSourceAwsIAMPolicy(), - "aws_iam_policy_document": dataSourceAwsIamPolicyDocument(), - "aws_iam_role": dataSourceAwsIAMRole(), - "aws_iam_server_certificate": dataSourceAwsIAMServerCertificate(), - "aws_iam_user": dataSourceAwsIAMUser(), - "aws_imagebuilder_component": dataSourceAwsImageBuilderComponent(), - "aws_imagebuilder_distribution_configuration": datasourceAwsImageBuilderDistributionConfiguration(), - "aws_imagebuilder_image_recipe": dataSourceAwsImageBuilderImageRecipe(), - "aws_imagebuilder_infrastructure_configuration": datasourceAwsImageBuilderInfrastructureConfiguration(), - "aws_internet_gateway": dataSourceAwsInternetGateway(), - "aws_iot_endpoint": dataSourceAwsIotEndpoint(), - "aws_inspector_rules_packages": dataSourceAwsInspectorRulesPackages(), - "aws_instance": dataSourceAwsInstance(), - "aws_instances": dataSourceAwsInstances(), - "aws_ip_ranges": dataSourceAwsIPRanges(), - "aws_kinesis_stream": dataSourceAwsKinesisStream(), - "aws_kms_alias": dataSourceAwsKmsAlias(), - "aws_kms_ciphertext": dataSourceAwsKmsCiphertext(), - "aws_kms_key": dataSourceAwsKmsKey(), - "aws_kms_secret": dataSourceAwsKmsSecret(), - "aws_kms_secrets": dataSourceAwsKmsSecrets(), - "aws_lambda_alias": dataSourceAwsLambdaAlias(), - "aws_lambda_code_signing_config": dataSourceAwsLambdaCodeSigningConfig(), - "aws_lambda_function": dataSourceAwsLambdaFunction(), - "aws_lambda_invocation": dataSourceAwsLambdaInvocation(), - "aws_lambda_layer_version": dataSourceAwsLambdaLayerVersion(), - "aws_launch_configuration": dataSourceAwsLaunchConfiguration(), - "aws_launch_template": dataSourceAwsLaunchTemplate(), - "aws_lex_bot": dataSourceAwsLexBot(), - "aws_lex_bot_alias": dataSourceAwsLexBotAlias(), - "aws_lex_intent": dataSourceAwsLexIntent(), - "aws_lex_slot_type": dataSourceAwsLexSlotType(), - "aws_mq_broker": dataSourceAwsMqBroker(), - "aws_msk_cluster": dataSourceAwsMskCluster(), - "aws_msk_configuration": dataSourceAwsMskConfiguration(), - "aws_nat_gateway": dataSourceAwsNatGateway(), - "aws_neptune_orderable_db_instance": dataSourceAwsNeptuneOrderableDbInstance(), - "aws_neptune_engine_version": dataSourceAwsNeptuneEngineVersion(), - "aws_network_acls": dataSourceAwsNetworkAcls(), - "aws_network_interface": dataSourceAwsNetworkInterface(), - "aws_network_interfaces": dataSourceAwsNetworkInterfaces(), - "aws_organizations_organization": dataSourceAwsOrganizationsOrganization(), - "aws_organizations_organizational_units": dataSourceAwsOrganizationsOrganizationalUnits(), - "aws_outposts_outpost": dataSourceAwsOutpostsOutpost(), - "aws_outposts_outpost_instance_type": dataSourceAwsOutpostsOutpostInstanceType(), - "aws_outposts_outpost_instance_types": dataSourceAwsOutpostsOutpostInstanceTypes(), - "aws_outposts_outposts": dataSourceAwsOutpostsOutposts(), - "aws_outposts_site": dataSourceAwsOutpostsSite(), - "aws_outposts_sites": dataSourceAwsOutpostsSites(), - "aws_partition": dataSourceAwsPartition(), - "aws_prefix_list": dataSourceAwsPrefixList(), - "aws_pricing_product": dataSourceAwsPricingProduct(), - "aws_qldb_ledger": dataSourceAwsQLDBLedger(), - "aws_ram_resource_share": dataSourceAwsRamResourceShare(), - "aws_rds_certificate": dataSourceAwsRdsCertificate(), - "aws_rds_cluster": dataSourceAwsRdsCluster(), - "aws_rds_engine_version": dataSourceAwsRdsEngineVersion(), - "aws_rds_orderable_db_instance": dataSourceAwsRdsOrderableDbInstance(), - "aws_redshift_cluster": dataSourceAwsRedshiftCluster(), - "aws_redshift_orderable_cluster": dataSourceAwsRedshiftOrderableCluster(), - "aws_redshift_service_account": dataSourceAwsRedshiftServiceAccount(), - "aws_region": dataSourceAwsRegion(), - "aws_regions": dataSourceAwsRegions(), - "aws_route": dataSourceAwsRoute(), - "aws_route_table": dataSourceAwsRouteTable(), - "aws_route_tables": dataSourceAwsRouteTables(), - "aws_route53_delegation_set": dataSourceAwsDelegationSet(), - "aws_route53_resolver_endpoint": dataSourceAwsRoute53ResolverEndpoint(), - "aws_route53_resolver_rule": dataSourceAwsRoute53ResolverRule(), - "aws_route53_resolver_rules": dataSourceAwsRoute53ResolverRules(), - "aws_route53_zone": dataSourceAwsRoute53Zone(), - "aws_s3_bucket": dataSourceAwsS3Bucket(), - "aws_s3_bucket_object": dataSourceAwsS3BucketObject(), - "aws_s3_bucket_objects": dataSourceAwsS3BucketObjects(), - "aws_sagemaker_prebuilt_ecr_image": dataSourceAwsSageMakerPrebuiltECRImage(), - "aws_secretsmanager_secret": dataSourceAwsSecretsManagerSecret(), - "aws_secretsmanager_secret_rotation": dataSourceAwsSecretsManagerSecretRotation(), - "aws_secretsmanager_secret_version": dataSourceAwsSecretsManagerSecretVersion(), - "aws_serverlessapplicationrepository_application": dataSourceAwsServerlessApplicationRepositoryApplication(), - "aws_servicequotas_service": dataSourceAwsServiceQuotasService(), - "aws_servicequotas_service_quota": dataSourceAwsServiceQuotasServiceQuota(), - "aws_sfn_activity": dataSourceAwsSfnActivity(), - "aws_sfn_state_machine": dataSourceAwsSfnStateMachine(), - "aws_signer_signing_job": dataSourceAwsSignerSigningJob(), - "aws_signer_signing_profile": dataSourceAwsSignerSigningProfile(), - "aws_sns_topic": dataSourceAwsSnsTopic(), - "aws_sqs_queue": dataSourceAwsSqsQueue(), - "aws_ssm_document": dataSourceAwsSsmDocument(), - "aws_ssm_parameter": dataSourceAwsSsmParameter(), - "aws_ssm_patch_baseline": dataSourceAwsSsmPatchBaseline(), - "aws_storagegateway_local_disk": dataSourceAwsStorageGatewayLocalDisk(), - "aws_subnet": dataSourceAwsSubnet(), - "aws_subnet_ids": dataSourceAwsSubnetIDs(), - "aws_transfer_server": dataSourceAwsTransferServer(), - "aws_vpcs": dataSourceAwsVpcs(), - "aws_security_group": dataSourceAwsSecurityGroup(), - "aws_security_groups": dataSourceAwsSecurityGroups(), - "aws_vpc": dataSourceAwsVpc(), - "aws_vpc_dhcp_options": dataSourceAwsVpcDhcpOptions(), - "aws_vpc_endpoint": dataSourceAwsVpcEndpoint(), - "aws_vpc_endpoint_service": dataSourceAwsVpcEndpointService(), - "aws_vpc_peering_connection": dataSourceAwsVpcPeeringConnection(), - "aws_vpc_peering_connections": dataSourceAwsVpcPeeringConnections(), - "aws_vpn_gateway": dataSourceAwsVpnGateway(), - "aws_waf_ipset": dataSourceAwsWafIpSet(), - "aws_waf_rule": dataSourceAwsWafRule(), - "aws_waf_rate_based_rule": dataSourceAwsWafRateBasedRule(), - "aws_waf_web_acl": dataSourceAwsWafWebAcl(), - "aws_wafregional_ipset": dataSourceAwsWafRegionalIpSet(), - "aws_wafregional_rule": dataSourceAwsWafRegionalRule(), - "aws_wafregional_rate_based_rule": dataSourceAwsWafRegionalRateBasedRule(), - "aws_wafregional_web_acl": dataSourceAwsWafRegionalWebAcl(), - "aws_wafv2_ip_set": dataSourceAwsWafv2IPSet(), - "aws_wafv2_regex_pattern_set": dataSourceAwsWafv2RegexPatternSet(), - "aws_wafv2_rule_group": dataSourceAwsWafv2RuleGroup(), - "aws_wafv2_web_acl": dataSourceAwsWafv2WebACL(), - "aws_workspaces_bundle": dataSourceAwsWorkspacesBundle(), - "aws_workspaces_directory": dataSourceAwsWorkspacesDirectory(), - "aws_workspaces_image": dataSourceAwsWorkspacesImage(), - "aws_workspaces_workspace": dataSourceAwsWorkspacesWorkspace(), + "aws_acm_certificate": dataSourceAwsAcmCertificate(), + "aws_acmpca_certificate_authority": dataSourceAwsAcmpcaCertificateAuthority(), + "aws_ami": dataSourceAwsAmi(), + "aws_ami_ids": dataSourceAwsAmiIds(), + "aws_api_gateway_api_key": dataSourceAwsApiGatewayApiKey(), + "aws_api_gateway_resource": dataSourceAwsApiGatewayResource(), + "aws_api_gateway_rest_api": dataSourceAwsApiGatewayRestApi(), + "aws_api_gateway_vpc_link": dataSourceAwsApiGatewayVpcLink(), + "aws_arn": dataSourceAwsArn(), + "aws_autoscaling_group": dataSourceAwsAutoscalingGroup(), + "aws_autoscaling_groups": dataSourceAwsAutoscalingGroups(), + "aws_availability_zone": dataSourceAwsAvailabilityZone(), + "aws_availability_zones": dataSourceAwsAvailabilityZones(), + "aws_backup_plan": dataSourceAwsBackupPlan(), + "aws_backup_selection": dataSourceAwsBackupSelection(), + "aws_backup_vault": dataSourceAwsBackupVault(), + "aws_batch_compute_environment": dataSourceAwsBatchComputeEnvironment(), + "aws_batch_job_queue": dataSourceAwsBatchJobQueue(), + "aws_billing_service_account": dataSourceAwsBillingServiceAccount(), + "aws_caller_identity": dataSourceAwsCallerIdentity(), + "aws_canonical_user_id": dataSourceAwsCanonicalUserId(), + "aws_cloudformation_export": dataSourceAwsCloudFormationExport(), + "aws_cloudformation_stack": dataSourceAwsCloudFormationStack(), + "aws_cloudfront_distribution": dataSourceAwsCloudFrontDistribution(), + "aws_cloudhsm_v2_cluster": dataSourceCloudHsmV2Cluster(), + "aws_cloudtrail_service_account": dataSourceAwsCloudTrailServiceAccount(), + "aws_cloudwatch_log_group": dataSourceAwsCloudwatchLogGroup(), + "aws_codeartifact_authorization_token": dataSourceAwsCodeArtifactAuthorizationToken(), + "aws_codeartifact_repository_endpoint": dataSourceAwsCodeArtifactRepositoryEndpoint(), + "aws_cognito_user_pools": dataSourceAwsCognitoUserPools(), + "aws_codecommit_repository": dataSourceAwsCodeCommitRepository(), + "aws_cur_report_definition": dataSourceAwsCurReportDefinition(), + "aws_db_cluster_snapshot": dataSourceAwsDbClusterSnapshot(), + "aws_db_event_categories": dataSourceAwsDbEventCategories(), + "aws_db_instance": dataSourceAwsDbInstance(), + "aws_db_snapshot": dataSourceAwsDbSnapshot(), + "aws_db_subnet_group": dataSourceAwsDbSubnetGroup(), + "aws_directory_service_directory": dataSourceAwsDirectoryServiceDirectory(), + "aws_docdb_engine_version": dataSourceAwsDocdbEngineVersion(), + "aws_docdb_orderable_db_instance": dataSourceAwsDocdbOrderableDbInstance(), + "aws_dx_gateway": dataSourceAwsDxGateway(), + "aws_dynamodb_table": dataSourceAwsDynamoDbTable(), + "aws_ebs_default_kms_key": dataSourceAwsEbsDefaultKmsKey(), + "aws_ebs_encryption_by_default": dataSourceAwsEbsEncryptionByDefault(), + "aws_ebs_snapshot": dataSourceAwsEbsSnapshot(), + "aws_ebs_snapshot_ids": dataSourceAwsEbsSnapshotIds(), + "aws_ebs_volume": dataSourceAwsEbsVolume(), + "aws_ebs_volumes": dataSourceAwsEbsVolumes(), + "aws_ec2_coip_pool": dataSourceAwsEc2CoipPool(), + "aws_ec2_coip_pools": dataSourceAwsEc2CoipPools(), + "aws_ec2_instance_type": dataSourceAwsEc2InstanceType(), + "aws_ec2_instance_type_offering": dataSourceAwsEc2InstanceTypeOffering(), + "aws_ec2_instance_type_offerings": dataSourceAwsEc2InstanceTypeOfferings(), + "aws_ec2_local_gateway": dataSourceAwsEc2LocalGateway(), + "aws_ec2_local_gateways": dataSourceAwsEc2LocalGateways(), + "aws_ec2_local_gateway_route_table": dataSourceAwsEc2LocalGatewayRouteTable(), + "aws_ec2_local_gateway_route_tables": dataSourceAwsEc2LocalGatewayRouteTables(), + "aws_ec2_local_gateway_virtual_interface": dataSourceAwsEc2LocalGatewayVirtualInterface(), + "aws_ec2_local_gateway_virtual_interface_group": dataSourceAwsEc2LocalGatewayVirtualInterfaceGroup(), + "aws_ec2_local_gateway_virtual_interface_groups": dataSourceAwsEc2LocalGatewayVirtualInterfaceGroups(), + "aws_ec2_spot_price": dataSourceAwsEc2SpotPrice(), + "aws_ec2_transit_gateway": dataSourceAwsEc2TransitGateway(), + "aws_ec2_transit_gateway_dx_gateway_attachment": dataSourceAwsEc2TransitGatewayDxGatewayAttachment(), + "aws_ec2_transit_gateway_peering_attachment": dataSourceAwsEc2TransitGatewayPeeringAttachment(), + "aws_ec2_transit_gateway_route_table": dataSourceAwsEc2TransitGatewayRouteTable(), + "aws_ec2_transit_gateway_vpc_attachment": dataSourceAwsEc2TransitGatewayVpcAttachment(), + "aws_ec2_transit_gateway_vpn_attachment": dataSourceAwsEc2TransitGatewayVpnAttachment(), + "aws_ecr_authorization_token": dataSourceAwsEcrAuthorizationToken(), + "aws_ecr_image": dataSourceAwsEcrImage(), + "aws_ecr_repository": dataSourceAwsEcrRepository(), + "aws_ecs_cluster": dataSourceAwsEcsCluster(), + "aws_ecs_container_definition": dataSourceAwsEcsContainerDefinition(), + "aws_ecs_service": dataSourceAwsEcsService(), + "aws_ecs_task_definition": dataSourceAwsEcsTaskDefinition(), + "aws_customer_gateway": dataSourceAwsCustomerGateway(), + "aws_efs_access_point": dataSourceAwsEfsAccessPoint(), + "aws_efs_access_points": dataSourceAwsEfsAccessPoints(), + "aws_efs_file_system": dataSourceAwsEfsFileSystem(), + "aws_efs_mount_target": dataSourceAwsEfsMountTarget(), + "aws_eip": dataSourceAwsEip(), + "aws_eks_cluster": dataSourceAwsEksCluster(), + "aws_eks_cluster_auth": dataSourceAwsEksClusterAuth(), + "aws_elastic_beanstalk_application": dataSourceAwsElasticBeanstalkApplication(), + "aws_elastic_beanstalk_hosted_zone": dataSourceAwsElasticBeanstalkHostedZone(), + "aws_elastic_beanstalk_solution_stack": dataSourceAwsElasticBeanstalkSolutionStack(), + "aws_elasticache_cluster": dataSourceAwsElastiCacheCluster(), + "aws_elasticsearch_domain": dataSourceAwsElasticSearchDomain(), + "aws_elb": dataSourceAwsElb(), + "aws_elasticache_replication_group": dataSourceAwsElasticacheReplicationGroup(), + "aws_elb_hosted_zone_id": dataSourceAwsElbHostedZoneId(), + "aws_elb_service_account": dataSourceAwsElbServiceAccount(), + "aws_glue_script": dataSourceAwsGlueScript(), + "aws_guardduty_detector": dataSourceAwsGuarddutyDetector(), + "aws_iam_account_alias": dataSourceAwsIamAccountAlias(), + "aws_iam_group": dataSourceAwsIAMGroup(), + "aws_iam_instance_profile": dataSourceAwsIAMInstanceProfile(), + "aws_iam_policy": dataSourceAwsIAMPolicy(), + "aws_iam_policy_document": dataSourceAwsIamPolicyDocument(), + "aws_iam_role": dataSourceAwsIAMRole(), + "aws_iam_server_certificate": dataSourceAwsIAMServerCertificate(), + "aws_iam_user": dataSourceAwsIAMUser(), + "aws_imagebuilder_component": dataSourceAwsImageBuilderComponent(), + "aws_imagebuilder_distribution_configuration": datasourceAwsImageBuilderDistributionConfiguration(), + "aws_imagebuilder_image_recipe": dataSourceAwsImageBuilderImageRecipe(), + "aws_imagebuilder_infrastructure_configuration": datasourceAwsImageBuilderInfrastructureConfiguration(), + "aws_internet_gateway": dataSourceAwsInternetGateway(), + "aws_iot_endpoint": dataSourceAwsIotEndpoint(), + "aws_inspector_rules_packages": dataSourceAwsInspectorRulesPackages(), + "aws_instance": dataSourceAwsInstance(), + "aws_instances": dataSourceAwsInstances(), + "aws_ip_ranges": dataSourceAwsIPRanges(), + "aws_kinesis_stream": dataSourceAwsKinesisStream(), + "aws_kms_alias": dataSourceAwsKmsAlias(), + "aws_kms_ciphertext": dataSourceAwsKmsCiphertext(), + "aws_kms_key": dataSourceAwsKmsKey(), + "aws_kms_secret": dataSourceAwsKmsSecret(), + "aws_kms_secrets": dataSourceAwsKmsSecrets(), + "aws_lambda_alias": dataSourceAwsLambdaAlias(), + "aws_lambda_code_signing_config": dataSourceAwsLambdaCodeSigningConfig(), + "aws_lambda_function": dataSourceAwsLambdaFunction(), + "aws_lambda_invocation": dataSourceAwsLambdaInvocation(), + "aws_lambda_layer_version": dataSourceAwsLambdaLayerVersion(), + "aws_launch_configuration": dataSourceAwsLaunchConfiguration(), + "aws_launch_template": dataSourceAwsLaunchTemplate(), + "aws_lex_bot": dataSourceAwsLexBot(), + "aws_lex_bot_alias": dataSourceAwsLexBotAlias(), + "aws_lex_intent": dataSourceAwsLexIntent(), + "aws_lex_slot_type": dataSourceAwsLexSlotType(), + "aws_mq_broker": dataSourceAwsMqBroker(), + "aws_msk_cluster": dataSourceAwsMskCluster(), + "aws_msk_configuration": dataSourceAwsMskConfiguration(), + "aws_nat_gateway": dataSourceAwsNatGateway(), + "aws_neptune_orderable_db_instance": dataSourceAwsNeptuneOrderableDbInstance(), + "aws_neptune_engine_version": dataSourceAwsNeptuneEngineVersion(), + "aws_network_acls": dataSourceAwsNetworkAcls(), + "aws_network_interface": dataSourceAwsNetworkInterface(), + "aws_network_interfaces": dataSourceAwsNetworkInterfaces(), + "aws_organizations_organization": dataSourceAwsOrganizationsOrganization(), + "aws_organizations_organizational_units": dataSourceAwsOrganizationsOrganizationalUnits(), + "aws_outposts_outpost": dataSourceAwsOutpostsOutpost(), + "aws_outposts_outpost_instance_type": dataSourceAwsOutpostsOutpostInstanceType(), + "aws_outposts_outpost_instance_types": dataSourceAwsOutpostsOutpostInstanceTypes(), + "aws_outposts_outposts": dataSourceAwsOutpostsOutposts(), + "aws_outposts_site": dataSourceAwsOutpostsSite(), + "aws_outposts_sites": dataSourceAwsOutpostsSites(), + "aws_partition": dataSourceAwsPartition(), + "aws_prefix_list": dataSourceAwsPrefixList(), + "aws_pricing_product": dataSourceAwsPricingProduct(), + "aws_qldb_ledger": dataSourceAwsQLDBLedger(), + "aws_ram_resource_share": dataSourceAwsRamResourceShare(), + "aws_rds_certificate": dataSourceAwsRdsCertificate(), + "aws_rds_cluster": dataSourceAwsRdsCluster(), + "aws_rds_engine_version": dataSourceAwsRdsEngineVersion(), + "aws_rds_orderable_db_instance": dataSourceAwsRdsOrderableDbInstance(), + "aws_redshift_cluster": dataSourceAwsRedshiftCluster(), + "aws_redshift_orderable_cluster": dataSourceAwsRedshiftOrderableCluster(), + "aws_redshift_service_account": dataSourceAwsRedshiftServiceAccount(), + "aws_region": dataSourceAwsRegion(), + "aws_regions": dataSourceAwsRegions(), + "aws_route": dataSourceAwsRoute(), + "aws_route_table": dataSourceAwsRouteTable(), + "aws_route_tables": dataSourceAwsRouteTables(), + "aws_route53_delegation_set": dataSourceAwsDelegationSet(), + "aws_route53_resolver_endpoint": dataSourceAwsRoute53ResolverEndpoint(), + "aws_route53_resolver_rule": dataSourceAwsRoute53ResolverRule(), + "aws_route53_resolver_rules": dataSourceAwsRoute53ResolverRules(), + "aws_route53_zone": dataSourceAwsRoute53Zone(), + "aws_s3_bucket": dataSourceAwsS3Bucket(), + "aws_s3_bucket_object": dataSourceAwsS3BucketObject(), + "aws_s3_bucket_objects": dataSourceAwsS3BucketObjects(), + "aws_sagemaker_prebuilt_ecr_image": dataSourceAwsSageMakerPrebuiltECRImage(), + "aws_secretsmanager_secret": dataSourceAwsSecretsManagerSecret(), + "aws_secretsmanager_secret_rotation": dataSourceAwsSecretsManagerSecretRotation(), + "aws_secretsmanager_secret_version": dataSourceAwsSecretsManagerSecretVersion(), + "aws_servicequotas_service": dataSourceAwsServiceQuotasService(), + "aws_servicequotas_service_quota": dataSourceAwsServiceQuotasServiceQuota(), + "aws_sfn_activity": dataSourceAwsSfnActivity(), + "aws_sfn_state_machine": dataSourceAwsSfnStateMachine(), + "aws_signer_signing_job": dataSourceAwsSignerSigningJob(), + "aws_signer_signing_profile": dataSourceAwsSignerSigningProfile(), + "aws_sns_topic": dataSourceAwsSnsTopic(), + "aws_sqs_queue": dataSourceAwsSqsQueue(), + "aws_ssm_document": dataSourceAwsSsmDocument(), + "aws_ssm_parameter": dataSourceAwsSsmParameter(), + "aws_ssm_patch_baseline": dataSourceAwsSsmPatchBaseline(), + "aws_storagegateway_local_disk": dataSourceAwsStorageGatewayLocalDisk(), + "aws_subnet": dataSourceAwsSubnet(), + "aws_subnet_ids": dataSourceAwsSubnetIDs(), + "aws_transfer_server": dataSourceAwsTransferServer(), + "aws_vpcs": dataSourceAwsVpcs(), + "aws_security_group": dataSourceAwsSecurityGroup(), + "aws_security_groups": dataSourceAwsSecurityGroups(), + "aws_vpc": dataSourceAwsVpc(), + "aws_vpc_dhcp_options": dataSourceAwsVpcDhcpOptions(), + "aws_vpc_endpoint": dataSourceAwsVpcEndpoint(), + "aws_vpc_endpoint_service": dataSourceAwsVpcEndpointService(), + "aws_vpc_peering_connection": dataSourceAwsVpcPeeringConnection(), + "aws_vpc_peering_connections": dataSourceAwsVpcPeeringConnections(), + "aws_vpn_gateway": dataSourceAwsVpnGateway(), + "aws_waf_ipset": dataSourceAwsWafIpSet(), + "aws_waf_rule": dataSourceAwsWafRule(), + "aws_waf_rate_based_rule": dataSourceAwsWafRateBasedRule(), + "aws_waf_web_acl": dataSourceAwsWafWebAcl(), + "aws_wafregional_ipset": dataSourceAwsWafRegionalIpSet(), + "aws_wafregional_rule": dataSourceAwsWafRegionalRule(), + "aws_wafregional_rate_based_rule": dataSourceAwsWafRegionalRateBasedRule(), + "aws_wafregional_web_acl": dataSourceAwsWafRegionalWebAcl(), + "aws_wafv2_ip_set": dataSourceAwsWafv2IPSet(), + "aws_wafv2_regex_pattern_set": dataSourceAwsWafv2RegexPatternSet(), + "aws_wafv2_rule_group": dataSourceAwsWafv2RuleGroup(), + "aws_wafv2_web_acl": dataSourceAwsWafv2WebACL(), + "aws_workspaces_bundle": dataSourceAwsWorkspacesBundle(), + "aws_workspaces_directory": dataSourceAwsWorkspacesDirectory(), + "aws_workspaces_image": dataSourceAwsWorkspacesImage(), + "aws_workspaces_workspace": dataSourceAwsWorkspacesWorkspace(), // Adding the Aliases for the ALB -> LB Rename "aws_lb": dataSourceAwsLb(), @@ -392,637 +391,636 @@ func Provider() *schema.Provider { }, ResourcesMap: map[string]*schema.Resource{ - "aws_accessanalyzer_analyzer": resourceAwsAccessAnalyzerAnalyzer(), - "aws_acm_certificate": resourceAwsAcmCertificate(), - "aws_acm_certificate_validation": resourceAwsAcmCertificateValidation(), - "aws_acmpca_certificate_authority": resourceAwsAcmpcaCertificateAuthority(), - "aws_ami": resourceAwsAmi(), - "aws_ami_copy": resourceAwsAmiCopy(), - "aws_ami_from_instance": resourceAwsAmiFromInstance(), - "aws_ami_launch_permission": resourceAwsAmiLaunchPermission(), - "aws_api_gateway_account": resourceAwsApiGatewayAccount(), - "aws_api_gateway_api_key": resourceAwsApiGatewayApiKey(), - "aws_api_gateway_authorizer": resourceAwsApiGatewayAuthorizer(), - "aws_api_gateway_base_path_mapping": resourceAwsApiGatewayBasePathMapping(), - "aws_api_gateway_client_certificate": resourceAwsApiGatewayClientCertificate(), - "aws_api_gateway_deployment": resourceAwsApiGatewayDeployment(), - "aws_api_gateway_documentation_part": resourceAwsApiGatewayDocumentationPart(), - "aws_api_gateway_documentation_version": resourceAwsApiGatewayDocumentationVersion(), - "aws_api_gateway_domain_name": resourceAwsApiGatewayDomainName(), - "aws_api_gateway_gateway_response": resourceAwsApiGatewayGatewayResponse(), - "aws_api_gateway_integration": resourceAwsApiGatewayIntegration(), - "aws_api_gateway_integration_response": resourceAwsApiGatewayIntegrationResponse(), - "aws_api_gateway_method": resourceAwsApiGatewayMethod(), - "aws_api_gateway_method_response": resourceAwsApiGatewayMethodResponse(), - "aws_api_gateway_method_settings": resourceAwsApiGatewayMethodSettings(), - "aws_api_gateway_model": resourceAwsApiGatewayModel(), - "aws_api_gateway_request_validator": resourceAwsApiGatewayRequestValidator(), - "aws_api_gateway_resource": resourceAwsApiGatewayResource(), - "aws_api_gateway_rest_api": resourceAwsApiGatewayRestApi(), - "aws_api_gateway_rest_api_policy": resourceAwsApiGatewayRestApiPolicy(), - "aws_api_gateway_stage": resourceAwsApiGatewayStage(), - "aws_api_gateway_usage_plan": resourceAwsApiGatewayUsagePlan(), - "aws_api_gateway_usage_plan_key": resourceAwsApiGatewayUsagePlanKey(), - "aws_api_gateway_vpc_link": resourceAwsApiGatewayVpcLink(), - "aws_apigatewayv2_api": resourceAwsApiGatewayV2Api(), - "aws_apigatewayv2_api_mapping": resourceAwsApiGatewayV2ApiMapping(), - "aws_apigatewayv2_authorizer": resourceAwsApiGatewayV2Authorizer(), - "aws_apigatewayv2_deployment": resourceAwsApiGatewayV2Deployment(), - "aws_apigatewayv2_domain_name": resourceAwsApiGatewayV2DomainName(), - "aws_apigatewayv2_integration": resourceAwsApiGatewayV2Integration(), - "aws_apigatewayv2_integration_response": resourceAwsApiGatewayV2IntegrationResponse(), - "aws_apigatewayv2_model": resourceAwsApiGatewayV2Model(), - "aws_apigatewayv2_route": resourceAwsApiGatewayV2Route(), - "aws_apigatewayv2_route_response": resourceAwsApiGatewayV2RouteResponse(), - "aws_apigatewayv2_stage": resourceAwsApiGatewayV2Stage(), - "aws_apigatewayv2_vpc_link": resourceAwsApiGatewayV2VpcLink(), - "aws_app_cookie_stickiness_policy": resourceAwsAppCookieStickinessPolicy(), - "aws_appautoscaling_target": resourceAwsAppautoscalingTarget(), - "aws_appautoscaling_policy": resourceAwsAppautoscalingPolicy(), - "aws_appautoscaling_scheduled_action": resourceAwsAppautoscalingScheduledAction(), - "aws_appmesh_gateway_route": resourceAwsAppmeshGatewayRoute(), - "aws_appmesh_mesh": resourceAwsAppmeshMesh(), - "aws_appmesh_route": resourceAwsAppmeshRoute(), - "aws_appmesh_virtual_gateway": resourceAwsAppmeshVirtualGateway(), - "aws_appmesh_virtual_node": resourceAwsAppmeshVirtualNode(), - "aws_appmesh_virtual_router": resourceAwsAppmeshVirtualRouter(), - "aws_appmesh_virtual_service": resourceAwsAppmeshVirtualService(), - "aws_appsync_api_key": resourceAwsAppsyncApiKey(), - "aws_appsync_datasource": resourceAwsAppsyncDatasource(), - "aws_appsync_function": resourceAwsAppsyncFunction(), - "aws_appsync_graphql_api": resourceAwsAppsyncGraphqlApi(), - "aws_appsync_resolver": resourceAwsAppsyncResolver(), - "aws_athena_database": resourceAwsAthenaDatabase(), - "aws_athena_named_query": resourceAwsAthenaNamedQuery(), - "aws_athena_workgroup": resourceAwsAthenaWorkgroup(), - "aws_autoscaling_attachment": resourceAwsAutoscalingAttachment(), - "aws_autoscaling_group": resourceAwsAutoscalingGroup(), - "aws_autoscaling_lifecycle_hook": resourceAwsAutoscalingLifecycleHook(), - "aws_autoscaling_notification": resourceAwsAutoscalingNotification(), - "aws_autoscaling_policy": resourceAwsAutoscalingPolicy(), - "aws_autoscaling_schedule": resourceAwsAutoscalingSchedule(), - "aws_autoscalingplans_scaling_plan": resourceAwsAutoScalingPlansScalingPlan(), - "aws_backup_plan": resourceAwsBackupPlan(), - "aws_backup_selection": resourceAwsBackupSelection(), - "aws_backup_vault": resourceAwsBackupVault(), - "aws_backup_vault_notifications": resourceAwsBackupVaultNotifications(), - "aws_backup_vault_policy": resourceAwsBackupVaultPolicy(), - "aws_budgets_budget": resourceAwsBudgetsBudget(), - "aws_cloud9_environment_ec2": resourceAwsCloud9EnvironmentEc2(), - "aws_cloudformation_stack": resourceAwsCloudFormationStack(), - "aws_cloudformation_stack_set": resourceAwsCloudFormationStackSet(), - "aws_cloudformation_stack_set_instance": resourceAwsCloudFormationStackSetInstance(), - "aws_cloudfront_distribution": resourceAwsCloudFrontDistribution(), - "aws_cloudfront_origin_access_identity": resourceAwsCloudFrontOriginAccessIdentity(), - "aws_cloudfront_public_key": resourceAwsCloudFrontPublicKey(), - "aws_cloudtrail": resourceAwsCloudTrail(), - "aws_cloudwatch_event_bus": resourceAwsCloudWatchEventBus(), - "aws_cloudwatch_event_permission": resourceAwsCloudWatchEventPermission(), - "aws_cloudwatch_event_rule": resourceAwsCloudWatchEventRule(), - "aws_cloudwatch_event_target": resourceAwsCloudWatchEventTarget(), - "aws_cloudwatch_log_destination": resourceAwsCloudWatchLogDestination(), - "aws_cloudwatch_log_destination_policy": resourceAwsCloudWatchLogDestinationPolicy(), - "aws_cloudwatch_log_group": resourceAwsCloudWatchLogGroup(), - "aws_cloudwatch_log_metric_filter": resourceAwsCloudWatchLogMetricFilter(), - "aws_cloudwatch_log_resource_policy": resourceAwsCloudWatchLogResourcePolicy(), - "aws_cloudwatch_log_stream": resourceAwsCloudWatchLogStream(), - "aws_cloudwatch_log_subscription_filter": resourceAwsCloudwatchLogSubscriptionFilter(), - "aws_config_aggregate_authorization": resourceAwsConfigAggregateAuthorization(), - "aws_config_config_rule": resourceAwsConfigConfigRule(), - "aws_config_configuration_aggregator": resourceAwsConfigConfigurationAggregator(), - "aws_config_configuration_recorder": resourceAwsConfigConfigurationRecorder(), - "aws_config_configuration_recorder_status": resourceAwsConfigConfigurationRecorderStatus(), - "aws_config_delivery_channel": resourceAwsConfigDeliveryChannel(), - "aws_config_organization_custom_rule": resourceAwsConfigOrganizationCustomRule(), - "aws_config_organization_managed_rule": resourceAwsConfigOrganizationManagedRule(), - "aws_config_remediation_configuration": resourceAwsConfigRemediationConfiguration(), - "aws_cognito_identity_pool": resourceAwsCognitoIdentityPool(), - "aws_cognito_identity_pool_roles_attachment": resourceAwsCognitoIdentityPoolRolesAttachment(), - "aws_cognito_identity_provider": resourceAwsCognitoIdentityProvider(), - "aws_cognito_user_group": resourceAwsCognitoUserGroup(), - "aws_cognito_user_pool": resourceAwsCognitoUserPool(), - "aws_cognito_user_pool_client": resourceAwsCognitoUserPoolClient(), - "aws_cognito_user_pool_domain": resourceAwsCognitoUserPoolDomain(), - "aws_cloudhsm_v2_cluster": resourceAwsCloudHsmV2Cluster(), - "aws_cloudhsm_v2_hsm": resourceAwsCloudHsmV2Hsm(), - "aws_cognito_resource_server": resourceAwsCognitoResourceServer(), - "aws_cloudwatch_metric_alarm": resourceAwsCloudWatchMetricAlarm(), - "aws_cloudwatch_dashboard": resourceAwsCloudWatchDashboard(), - "aws_codedeploy_app": resourceAwsCodeDeployApp(), - "aws_codedeploy_deployment_config": resourceAwsCodeDeployDeploymentConfig(), - "aws_codedeploy_deployment_group": resourceAwsCodeDeployDeploymentGroup(), - "aws_codecommit_repository": resourceAwsCodeCommitRepository(), - "aws_codecommit_trigger": resourceAwsCodeCommitTrigger(), - "aws_codeartifact_domain": resourceAwsCodeArtifactDomain(), - "aws_codeartifact_domain_permissions_policy": resourceAwsCodeArtifactDomainPermissionsPolicy(), - "aws_codeartifact_repository": resourceAwsCodeArtifactRepository(), - "aws_codeartifact_repository_permissions_policy": resourceAwsCodeArtifactRepositoryPermissionsPolicy(), - "aws_codebuild_project": resourceAwsCodeBuildProject(), - "aws_codebuild_report_group": resourceAwsCodeBuildReportGroup(), - "aws_codebuild_source_credential": resourceAwsCodeBuildSourceCredential(), - "aws_codebuild_webhook": resourceAwsCodeBuildWebhook(), - "aws_codepipeline": resourceAwsCodePipeline(), - "aws_codepipeline_webhook": resourceAwsCodePipelineWebhook(), - "aws_codestarnotifications_notification_rule": resourceAwsCodeStarNotificationsNotificationRule(), - "aws_cur_report_definition": resourceAwsCurReportDefinition(), - "aws_customer_gateway": resourceAwsCustomerGateway(), - "aws_datapipeline_pipeline": resourceAwsDataPipelinePipeline(), - "aws_datasync_agent": resourceAwsDataSyncAgent(), - "aws_datasync_location_efs": resourceAwsDataSyncLocationEfs(), - "aws_datasync_location_fsx_windows_file_system": resourceAwsDataSyncLocationFsxWindowsFileSystem(), - "aws_datasync_location_nfs": resourceAwsDataSyncLocationNfs(), - "aws_datasync_location_s3": resourceAwsDataSyncLocationS3(), - "aws_datasync_location_smb": resourceAwsDataSyncLocationSmb(), - "aws_datasync_task": resourceAwsDataSyncTask(), - "aws_dax_cluster": resourceAwsDaxCluster(), - "aws_dax_parameter_group": resourceAwsDaxParameterGroup(), - "aws_dax_subnet_group": resourceAwsDaxSubnetGroup(), - "aws_db_cluster_snapshot": resourceAwsDbClusterSnapshot(), - "aws_db_event_subscription": resourceAwsDbEventSubscription(), - "aws_db_instance": resourceAwsDbInstance(), - "aws_db_instance_role_association": resourceAwsDbInstanceRoleAssociation(), - "aws_db_option_group": resourceAwsDbOptionGroup(), - "aws_db_parameter_group": resourceAwsDbParameterGroup(), - "aws_db_proxy": resourceAwsDbProxy(), - "aws_db_proxy_default_target_group": resourceAwsDbProxyDefaultTargetGroup(), - "aws_db_proxy_target": resourceAwsDbProxyTarget(), - "aws_db_security_group": resourceAwsDbSecurityGroup(), - "aws_db_snapshot": resourceAwsDbSnapshot(), - "aws_db_subnet_group": resourceAwsDbSubnetGroup(), - "aws_devicefarm_project": resourceAwsDevicefarmProject(), - "aws_directory_service_directory": resourceAwsDirectoryServiceDirectory(), - "aws_directory_service_conditional_forwarder": resourceAwsDirectoryServiceConditionalForwarder(), - "aws_directory_service_log_subscription": resourceAwsDirectoryServiceLogSubscription(), - "aws_dlm_lifecycle_policy": resourceAwsDlmLifecyclePolicy(), - "aws_dms_certificate": resourceAwsDmsCertificate(), - "aws_dms_endpoint": resourceAwsDmsEndpoint(), - "aws_dms_event_subscription": resourceAwsDmsEventSubscription(), - "aws_dms_replication_instance": resourceAwsDmsReplicationInstance(), - "aws_dms_replication_subnet_group": resourceAwsDmsReplicationSubnetGroup(), - "aws_dms_replication_task": resourceAwsDmsReplicationTask(), - "aws_docdb_cluster": resourceAwsDocDBCluster(), - "aws_docdb_cluster_instance": resourceAwsDocDBClusterInstance(), - "aws_docdb_cluster_parameter_group": resourceAwsDocDBClusterParameterGroup(), - "aws_docdb_cluster_snapshot": resourceAwsDocDBClusterSnapshot(), - "aws_docdb_subnet_group": resourceAwsDocDBSubnetGroup(), - "aws_dx_bgp_peer": resourceAwsDxBgpPeer(), - "aws_dx_connection": resourceAwsDxConnection(), - "aws_dx_connection_association": resourceAwsDxConnectionAssociation(), - "aws_dx_gateway": resourceAwsDxGateway(), - "aws_dx_gateway_association": resourceAwsDxGatewayAssociation(), - "aws_dx_gateway_association_proposal": resourceAwsDxGatewayAssociationProposal(), - "aws_dx_hosted_private_virtual_interface": resourceAwsDxHostedPrivateVirtualInterface(), - "aws_dx_hosted_private_virtual_interface_accepter": resourceAwsDxHostedPrivateVirtualInterfaceAccepter(), - "aws_dx_hosted_public_virtual_interface": resourceAwsDxHostedPublicVirtualInterface(), - "aws_dx_hosted_public_virtual_interface_accepter": resourceAwsDxHostedPublicVirtualInterfaceAccepter(), - "aws_dx_hosted_transit_virtual_interface": resourceAwsDxHostedTransitVirtualInterface(), - "aws_dx_hosted_transit_virtual_interface_accepter": resourceAwsDxHostedTransitVirtualInterfaceAccepter(), - "aws_dx_lag": resourceAwsDxLag(), - "aws_dx_private_virtual_interface": resourceAwsDxPrivateVirtualInterface(), - "aws_dx_public_virtual_interface": resourceAwsDxPublicVirtualInterface(), - "aws_dx_transit_virtual_interface": resourceAwsDxTransitVirtualInterface(), - "aws_dynamodb_table": resourceAwsDynamoDbTable(), - "aws_dynamodb_table_item": resourceAwsDynamoDbTableItem(), - "aws_dynamodb_global_table": resourceAwsDynamoDbGlobalTable(), - "aws_ebs_default_kms_key": resourceAwsEbsDefaultKmsKey(), - "aws_ebs_encryption_by_default": resourceAwsEbsEncryptionByDefault(), - "aws_ebs_snapshot": resourceAwsEbsSnapshot(), - "aws_ebs_snapshot_copy": resourceAwsEbsSnapshotCopy(), - "aws_ebs_volume": resourceAwsEbsVolume(), - "aws_ec2_availability_zone_group": resourceAwsEc2AvailabilityZoneGroup(), - "aws_ec2_capacity_reservation": resourceAwsEc2CapacityReservation(), - "aws_ec2_client_vpn_authorization_rule": resourceAwsEc2ClientVpnAuthorizationRule(), - "aws_ec2_client_vpn_endpoint": resourceAwsEc2ClientVpnEndpoint(), - "aws_ec2_client_vpn_network_association": resourceAwsEc2ClientVpnNetworkAssociation(), - "aws_ec2_client_vpn_route": resourceAwsEc2ClientVpnRoute(), - "aws_ec2_fleet": resourceAwsEc2Fleet(), - "aws_ec2_local_gateway_route": resourceAwsEc2LocalGatewayRoute(), - "aws_ec2_local_gateway_route_table_vpc_association": resourceAwsEc2LocalGatewayRouteTableVpcAssociation(), - "aws_ec2_tag": resourceAwsEc2Tag(), - "aws_ec2_traffic_mirror_filter": resourceAwsEc2TrafficMirrorFilter(), - "aws_ec2_traffic_mirror_filter_rule": resourceAwsEc2TrafficMirrorFilterRule(), - "aws_ec2_traffic_mirror_target": resourceAwsEc2TrafficMirrorTarget(), - "aws_ec2_traffic_mirror_session": resourceAwsEc2TrafficMirrorSession(), - "aws_ec2_transit_gateway": resourceAwsEc2TransitGateway(), - "aws_ec2_transit_gateway_peering_attachment": resourceAwsEc2TransitGatewayPeeringAttachment(), - "aws_ec2_transit_gateway_peering_attachment_accepter": resourceAwsEc2TransitGatewayPeeringAttachmentAccepter(), - "aws_ec2_transit_gateway_route": resourceAwsEc2TransitGatewayRoute(), - "aws_ec2_transit_gateway_route_table": resourceAwsEc2TransitGatewayRouteTable(), - "aws_ec2_transit_gateway_route_table_association": resourceAwsEc2TransitGatewayRouteTableAssociation(), - "aws_ec2_transit_gateway_route_table_propagation": resourceAwsEc2TransitGatewayRouteTablePropagation(), - "aws_ec2_transit_gateway_vpc_attachment": resourceAwsEc2TransitGatewayVpcAttachment(), - "aws_ec2_transit_gateway_vpc_attachment_accepter": resourceAwsEc2TransitGatewayVpcAttachmentAccepter(), - "aws_ecr_lifecycle_policy": resourceAwsEcrLifecyclePolicy(), - "aws_ecr_repository": resourceAwsEcrRepository(), - "aws_ecr_repository_policy": resourceAwsEcrRepositoryPolicy(), - "aws_ecs_capacity_provider": resourceAwsEcsCapacityProvider(), - "aws_ecs_cluster": resourceAwsEcsCluster(), - "aws_ecs_service": resourceAwsEcsService(), - "aws_ecs_task_definition": resourceAwsEcsTaskDefinition(), - "aws_efs_access_point": resourceAwsEfsAccessPoint(), - "aws_efs_file_system": resourceAwsEfsFileSystem(), - "aws_efs_file_system_policy": resourceAwsEfsFileSystemPolicy(), - "aws_efs_mount_target": resourceAwsEfsMountTarget(), - "aws_egress_only_internet_gateway": resourceAwsEgressOnlyInternetGateway(), - "aws_eip": resourceAwsEip(), - "aws_eip_association": resourceAwsEipAssociation(), - "aws_eks_cluster": resourceAwsEksCluster(), - "aws_eks_fargate_profile": resourceAwsEksFargateProfile(), - "aws_eks_node_group": resourceAwsEksNodeGroup(), - "aws_elasticache_cluster": resourceAwsElasticacheCluster(), - "aws_elasticache_parameter_group": resourceAwsElasticacheParameterGroup(), - "aws_elasticache_replication_group": resourceAwsElasticacheReplicationGroup(), - "aws_elasticache_security_group": resourceAwsElasticacheSecurityGroup(), - "aws_elasticache_subnet_group": resourceAwsElasticacheSubnetGroup(), - "aws_elastic_beanstalk_application": resourceAwsElasticBeanstalkApplication(), - "aws_elastic_beanstalk_application_version": resourceAwsElasticBeanstalkApplicationVersion(), - "aws_elastic_beanstalk_configuration_template": resourceAwsElasticBeanstalkConfigurationTemplate(), - "aws_elastic_beanstalk_environment": resourceAwsElasticBeanstalkEnvironment(), - "aws_elasticsearch_domain": resourceAwsElasticSearchDomain(), - "aws_elasticsearch_domain_policy": resourceAwsElasticSearchDomainPolicy(), - "aws_elastictranscoder_pipeline": resourceAwsElasticTranscoderPipeline(), - "aws_elastictranscoder_preset": resourceAwsElasticTranscoderPreset(), - "aws_elb": resourceAwsElb(), - "aws_elb_attachment": resourceAwsElbAttachment(), - "aws_emr_cluster": resourceAwsEMRCluster(), - "aws_emr_instance_group": resourceAwsEMRInstanceGroup(), - "aws_emr_instance_fleet": resourceAwsEMRInstanceFleet(), - "aws_emr_managed_scaling_policy": resourceAwsEMRManagedScalingPolicy(), - "aws_emr_security_configuration": resourceAwsEMRSecurityConfiguration(), - "aws_flow_log": resourceAwsFlowLog(), - "aws_fsx_lustre_file_system": resourceAwsFsxLustreFileSystem(), - "aws_fsx_windows_file_system": resourceAwsFsxWindowsFileSystem(), - "aws_fms_admin_account": resourceAwsFmsAdminAccount(), - "aws_gamelift_alias": resourceAwsGameliftAlias(), - "aws_gamelift_build": resourceAwsGameliftBuild(), - "aws_gamelift_fleet": resourceAwsGameliftFleet(), - "aws_gamelift_game_session_queue": resourceAwsGameliftGameSessionQueue(), - "aws_glacier_vault": resourceAwsGlacierVault(), - "aws_glacier_vault_lock": resourceAwsGlacierVaultLock(), - "aws_globalaccelerator_accelerator": resourceAwsGlobalAcceleratorAccelerator(), - "aws_globalaccelerator_endpoint_group": resourceAwsGlobalAcceleratorEndpointGroup(), - "aws_globalaccelerator_listener": resourceAwsGlobalAcceleratorListener(), - "aws_glue_catalog_database": resourceAwsGlueCatalogDatabase(), - "aws_glue_catalog_table": resourceAwsGlueCatalogTable(), - "aws_glue_classifier": resourceAwsGlueClassifier(), - "aws_glue_connection": resourceAwsGlueConnection(), - "aws_glue_dev_endpoint": resourceAwsGlueDevEndpoint(), - "aws_glue_crawler": resourceAwsGlueCrawler(), - "aws_glue_data_catalog_encryption_settings": resourceAwsGlueDataCatalogEncryptionSettings(), - "aws_glue_job": resourceAwsGlueJob(), - "aws_glue_ml_transform": resourceAwsGlueMLTransform(), - "aws_glue_partition": resourceAwsGluePartition(), - "aws_glue_security_configuration": resourceAwsGlueSecurityConfiguration(), - "aws_glue_trigger": resourceAwsGlueTrigger(), - "aws_glue_user_defined_function": resourceAwsGlueUserDefinedFunction(), - "aws_glue_workflow": resourceAwsGlueWorkflow(), - "aws_glue_resource_policy": resourceAwsGlueResourcePolicy(), - "aws_guardduty_detector": resourceAwsGuardDutyDetector(), - "aws_guardduty_filter": resourceAwsGuardDutyFilter(), - "aws_guardduty_invite_accepter": resourceAwsGuardDutyInviteAccepter(), - "aws_guardduty_ipset": resourceAwsGuardDutyIpset(), - "aws_guardduty_member": resourceAwsGuardDutyMember(), - "aws_guardduty_organization_admin_account": resourceAwsGuardDutyOrganizationAdminAccount(), - "aws_guardduty_organization_configuration": resourceAwsGuardDutyOrganizationConfiguration(), - "aws_guardduty_publishing_destination": resourceAwsGuardDutyPublishingDestination(), - "aws_guardduty_threatintelset": resourceAwsGuardDutyThreatintelset(), - "aws_iam_access_key": resourceAwsIamAccessKey(), - "aws_iam_account_alias": resourceAwsIamAccountAlias(), - "aws_iam_account_password_policy": resourceAwsIamAccountPasswordPolicy(), - "aws_iam_group_policy": resourceAwsIamGroupPolicy(), - "aws_iam_group": resourceAwsIamGroup(), - "aws_iam_group_membership": resourceAwsIamGroupMembership(), - "aws_iam_group_policy_attachment": resourceAwsIamGroupPolicyAttachment(), - "aws_iam_instance_profile": resourceAwsIamInstanceProfile(), - "aws_iam_openid_connect_provider": resourceAwsIamOpenIDConnectProvider(), - "aws_iam_policy": resourceAwsIamPolicy(), - "aws_iam_policy_attachment": resourceAwsIamPolicyAttachment(), - "aws_iam_role_policy_attachment": resourceAwsIamRolePolicyAttachment(), - "aws_iam_role_policy": resourceAwsIamRolePolicy(), - "aws_iam_role": resourceAwsIamRole(), - "aws_iam_saml_provider": resourceAwsIamSamlProvider(), - "aws_iam_server_certificate": resourceAwsIAMServerCertificate(), - "aws_iam_service_linked_role": resourceAwsIamServiceLinkedRole(), - "aws_iam_user_group_membership": resourceAwsIamUserGroupMembership(), - "aws_iam_user_policy_attachment": resourceAwsIamUserPolicyAttachment(), - "aws_iam_user_policy": resourceAwsIamUserPolicy(), - "aws_iam_user_ssh_key": resourceAwsIamUserSshKey(), - "aws_iam_user": resourceAwsIamUser(), - "aws_iam_user_login_profile": resourceAwsIamUserLoginProfile(), - "aws_imagebuilder_component": resourceAwsImageBuilderComponent(), - "aws_imagebuilder_distribution_configuration": resourceAwsImageBuilderDistributionConfiguration(), - "aws_imagebuilder_image_recipe": resourceAwsImageBuilderImageRecipe(), - "aws_imagebuilder_infrastructure_configuration": resourceAwsImageBuilderInfrastructureConfiguration(), - "aws_inspector_assessment_target": resourceAWSInspectorAssessmentTarget(), - "aws_inspector_assessment_template": resourceAWSInspectorAssessmentTemplate(), - "aws_inspector_resource_group": resourceAWSInspectorResourceGroup(), - "aws_instance": resourceAwsInstance(), - "aws_internet_gateway": resourceAwsInternetGateway(), - "aws_iot_certificate": resourceAwsIotCertificate(), - "aws_iot_policy": resourceAwsIotPolicy(), - "aws_iot_policy_attachment": resourceAwsIotPolicyAttachment(), - "aws_iot_thing": resourceAwsIotThing(), - "aws_iot_thing_principal_attachment": resourceAwsIotThingPrincipalAttachment(), - "aws_iot_thing_type": resourceAwsIotThingType(), - "aws_iot_topic_rule": resourceAwsIotTopicRule(), - "aws_iot_role_alias": resourceAwsIotRoleAlias(), - "aws_key_pair": resourceAwsKeyPair(), - "aws_kinesis_analytics_application": resourceAwsKinesisAnalyticsApplication(), - "aws_kinesisanalyticsv2_application": resourceAwsKinesisAnalyticsV2Application(), - "aws_kinesis_firehose_delivery_stream": resourceAwsKinesisFirehoseDeliveryStream(), - "aws_kinesis_stream": resourceAwsKinesisStream(), - "aws_kinesis_video_stream": resourceAwsKinesisVideoStream(), - "aws_kms_alias": resourceAwsKmsAlias(), - "aws_kms_external_key": resourceAwsKmsExternalKey(), - "aws_kms_grant": resourceAwsKmsGrant(), - "aws_kms_key": resourceAwsKmsKey(), - "aws_kms_ciphertext": resourceAwsKmsCiphertext(), - "aws_lambda_alias": resourceAwsLambdaAlias(), - "aws_lambda_code_signing_config": resourceAwsLambdaCodeSigningConfig(), - "aws_lambda_event_source_mapping": resourceAwsLambdaEventSourceMapping(), - "aws_lambda_function_event_invoke_config": resourceAwsLambdaFunctionEventInvokeConfig(), - "aws_lambda_function": resourceAwsLambdaFunction(), - "aws_lambda_layer_version": resourceAwsLambdaLayerVersion(), - "aws_lambda_permission": resourceAwsLambdaPermission(), - "aws_lambda_provisioned_concurrency_config": resourceAwsLambdaProvisionedConcurrencyConfig(), - "aws_launch_configuration": resourceAwsLaunchConfiguration(), - "aws_launch_template": resourceAwsLaunchTemplate(), - "aws_lex_bot": resourceAwsLexBot(), - "aws_lex_bot_alias": resourceAwsLexBotAlias(), - "aws_lex_intent": resourceAwsLexIntent(), - "aws_lex_slot_type": resourceAwsLexSlotType(), - "aws_licensemanager_association": resourceAwsLicenseManagerAssociation(), - "aws_licensemanager_license_configuration": resourceAwsLicenseManagerLicenseConfiguration(), - "aws_lightsail_domain": resourceAwsLightsailDomain(), - "aws_lightsail_instance": resourceAwsLightsailInstance(), - "aws_lightsail_key_pair": resourceAwsLightsailKeyPair(), - "aws_lightsail_static_ip": resourceAwsLightsailStaticIp(), - "aws_lightsail_static_ip_attachment": resourceAwsLightsailStaticIpAttachment(), - "aws_lb_cookie_stickiness_policy": resourceAwsLBCookieStickinessPolicy(), - "aws_load_balancer_policy": resourceAwsLoadBalancerPolicy(), - "aws_load_balancer_backend_server_policy": resourceAwsLoadBalancerBackendServerPolicies(), - "aws_load_balancer_listener_policy": resourceAwsLoadBalancerListenerPolicies(), - "aws_lb_ssl_negotiation_policy": resourceAwsLBSSLNegotiationPolicy(), - "aws_macie_member_account_association": resourceAwsMacieMemberAccountAssociation(), - "aws_macie_s3_bucket_association": resourceAwsMacieS3BucketAssociation(), - "aws_main_route_table_association": resourceAwsMainRouteTableAssociation(), - "aws_mq_broker": resourceAwsMqBroker(), - "aws_mq_configuration": resourceAwsMqConfiguration(), - "aws_media_convert_queue": resourceAwsMediaConvertQueue(), - "aws_media_package_channel": resourceAwsMediaPackageChannel(), - "aws_media_store_container": resourceAwsMediaStoreContainer(), - "aws_media_store_container_policy": resourceAwsMediaStoreContainerPolicy(), - "aws_msk_cluster": resourceAwsMskCluster(), - "aws_msk_configuration": resourceAwsMskConfiguration(), - "aws_nat_gateway": resourceAwsNatGateway(), - "aws_network_acl": resourceAwsNetworkAcl(), - "aws_default_network_acl": resourceAwsDefaultNetworkAcl(), - "aws_neptune_cluster": resourceAwsNeptuneCluster(), - "aws_neptune_cluster_instance": resourceAwsNeptuneClusterInstance(), - "aws_neptune_cluster_parameter_group": resourceAwsNeptuneClusterParameterGroup(), - "aws_neptune_cluster_snapshot": resourceAwsNeptuneClusterSnapshot(), - "aws_neptune_event_subscription": resourceAwsNeptuneEventSubscription(), - "aws_neptune_parameter_group": resourceAwsNeptuneParameterGroup(), - "aws_neptune_subnet_group": resourceAwsNeptuneSubnetGroup(), - "aws_network_acl_rule": resourceAwsNetworkAclRule(), - "aws_network_interface": resourceAwsNetworkInterface(), - "aws_network_interface_attachment": resourceAwsNetworkInterfaceAttachment(), - "aws_networkfirewall_firewall": resourceAwsNetworkFirewallFirewall(), - "aws_networkfirewall_firewall_policy": resourceAwsNetworkFirewallFirewallPolicy(), - "aws_networkfirewall_logging_configuration": resourceAwsNetworkFirewallLoggingConfiguration(), - "aws_networkfirewall_rule_group": resourceAwsNetworkFirewallRuleGroup(), - "aws_opsworks_application": resourceAwsOpsworksApplication(), - "aws_opsworks_stack": resourceAwsOpsworksStack(), - "aws_opsworks_java_app_layer": resourceAwsOpsworksJavaAppLayer(), - "aws_opsworks_haproxy_layer": resourceAwsOpsworksHaproxyLayer(), - "aws_opsworks_static_web_layer": resourceAwsOpsworksStaticWebLayer(), - "aws_opsworks_php_app_layer": resourceAwsOpsworksPhpAppLayer(), - "aws_opsworks_rails_app_layer": resourceAwsOpsworksRailsAppLayer(), - "aws_opsworks_nodejs_app_layer": resourceAwsOpsworksNodejsAppLayer(), - "aws_opsworks_memcached_layer": resourceAwsOpsworksMemcachedLayer(), - "aws_opsworks_mysql_layer": resourceAwsOpsworksMysqlLayer(), - "aws_opsworks_ganglia_layer": resourceAwsOpsworksGangliaLayer(), - "aws_opsworks_custom_layer": resourceAwsOpsworksCustomLayer(), - "aws_opsworks_instance": resourceAwsOpsworksInstance(), - "aws_opsworks_user_profile": resourceAwsOpsworksUserProfile(), - "aws_opsworks_permission": resourceAwsOpsworksPermission(), - "aws_opsworks_rds_db_instance": resourceAwsOpsworksRdsDbInstance(), - "aws_organizations_organization": resourceAwsOrganizationsOrganization(), - "aws_organizations_account": resourceAwsOrganizationsAccount(), - "aws_organizations_policy": resourceAwsOrganizationsPolicy(), - "aws_organizations_policy_attachment": resourceAwsOrganizationsPolicyAttachment(), - "aws_organizations_organizational_unit": resourceAwsOrganizationsOrganizationalUnit(), - "aws_placement_group": resourceAwsPlacementGroup(), - "aws_proxy_protocol_policy": resourceAwsProxyProtocolPolicy(), - "aws_qldb_ledger": resourceAwsQLDBLedger(), - "aws_quicksight_group": resourceAwsQuickSightGroup(), - "aws_quicksight_user": resourceAwsQuickSightUser(), - "aws_ram_principal_association": resourceAwsRamPrincipalAssociation(), - "aws_ram_resource_association": resourceAwsRamResourceAssociation(), - "aws_ram_resource_share": resourceAwsRamResourceShare(), - "aws_ram_resource_share_accepter": resourceAwsRamResourceShareAccepter(), - "aws_rds_cluster": resourceAwsRDSCluster(), - "aws_rds_cluster_endpoint": resourceAwsRDSClusterEndpoint(), - "aws_rds_cluster_instance": resourceAwsRDSClusterInstance(), - "aws_rds_cluster_parameter_group": resourceAwsRDSClusterParameterGroup(), - "aws_rds_global_cluster": resourceAwsRDSGlobalCluster(), - "aws_redshift_cluster": resourceAwsRedshiftCluster(), - "aws_redshift_security_group": resourceAwsRedshiftSecurityGroup(), - "aws_redshift_parameter_group": resourceAwsRedshiftParameterGroup(), - "aws_redshift_subnet_group": resourceAwsRedshiftSubnetGroup(), - "aws_redshift_snapshot_copy_grant": resourceAwsRedshiftSnapshotCopyGrant(), - "aws_redshift_snapshot_schedule": resourceAwsRedshiftSnapshotSchedule(), - "aws_redshift_snapshot_schedule_association": resourceAwsRedshiftSnapshotScheduleAssociation(), - "aws_redshift_event_subscription": resourceAwsRedshiftEventSubscription(), - "aws_resourcegroups_group": resourceAwsResourceGroupsGroup(), - "aws_route53_delegation_set": resourceAwsRoute53DelegationSet(), - "aws_route53_query_log": resourceAwsRoute53QueryLog(), - "aws_route53_record": resourceAwsRoute53Record(), - "aws_route53_zone_association": resourceAwsRoute53ZoneAssociation(), - "aws_route53_vpc_association_authorization": resourceAwsRoute53VPCAssociationAuthorization(), - "aws_route53_zone": resourceAwsRoute53Zone(), - "aws_route53_health_check": resourceAwsRoute53HealthCheck(), - "aws_route53_resolver_endpoint": resourceAwsRoute53ResolverEndpoint(), - "aws_route53_resolver_query_log_config": resourceAwsRoute53ResolverQueryLogConfig(), - "aws_route53_resolver_query_log_config_association": resourceAwsRoute53ResolverQueryLogConfigAssociation(), - "aws_route53_resolver_rule_association": resourceAwsRoute53ResolverRuleAssociation(), - "aws_route53_resolver_rule": resourceAwsRoute53ResolverRule(), - "aws_route": resourceAwsRoute(), - "aws_route_table": resourceAwsRouteTable(), - "aws_default_route_table": resourceAwsDefaultRouteTable(), - "aws_route_table_association": resourceAwsRouteTableAssociation(), - "aws_sagemaker_code_repository": resourceAwsSagemakerCodeRepository(), - "aws_sagemaker_model": resourceAwsSagemakerModel(), - "aws_sagemaker_endpoint_configuration": resourceAwsSagemakerEndpointConfiguration(), - "aws_sagemaker_endpoint": resourceAwsSagemakerEndpoint(), - "aws_sagemaker_notebook_instance_lifecycle_configuration": resourceAwsSagemakerNotebookInstanceLifeCycleConfiguration(), - "aws_sagemaker_notebook_instance": resourceAwsSagemakerNotebookInstance(), - "aws_secretsmanager_secret": resourceAwsSecretsManagerSecret(), - "aws_secretsmanager_secret_policy": resourceAwsSecretsManagerSecretPolicy(), - "aws_secretsmanager_secret_version": resourceAwsSecretsManagerSecretVersion(), - "aws_secretsmanager_secret_rotation": resourceAwsSecretsManagerSecretRotation(), - "aws_ses_active_receipt_rule_set": resourceAwsSesActiveReceiptRuleSet(), - "aws_ses_domain_identity": resourceAwsSesDomainIdentity(), - "aws_ses_domain_identity_verification": resourceAwsSesDomainIdentityVerification(), - "aws_ses_domain_dkim": resourceAwsSesDomainDkim(), - "aws_ses_domain_mail_from": resourceAwsSesDomainMailFrom(), - "aws_ses_email_identity": resourceAwsSesEmailIdentity(), - "aws_ses_identity_policy": resourceAwsSesIdentityPolicy(), - "aws_ses_receipt_filter": resourceAwsSesReceiptFilter(), - "aws_ses_receipt_rule": resourceAwsSesReceiptRule(), - "aws_ses_receipt_rule_set": resourceAwsSesReceiptRuleSet(), - "aws_ses_configuration_set": resourceAwsSesConfigurationSet(), - "aws_ses_event_destination": resourceAwsSesEventDestination(), - "aws_ses_identity_notification_topic": resourceAwsSesNotificationTopic(), - "aws_ses_template": resourceAwsSesTemplate(), - "aws_s3_access_point": resourceAwsS3AccessPoint(), - "aws_s3_account_public_access_block": resourceAwsS3AccountPublicAccessBlock(), - "aws_s3_bucket": resourceAwsS3Bucket(), - "aws_s3_bucket_analytics_configuration": resourceAwsS3BucketAnalyticsConfiguration(), - "aws_s3_bucket_policy": resourceAwsS3BucketPolicy(), - "aws_s3_bucket_public_access_block": resourceAwsS3BucketPublicAccessBlock(), - "aws_s3_bucket_object": resourceAwsS3BucketObject(), - "aws_s3_bucket_ownership_controls": resourceAwsS3BucketOwnershipControls(), - "aws_s3_bucket_notification": resourceAwsS3BucketNotification(), - "aws_s3_bucket_metric": resourceAwsS3BucketMetric(), - "aws_s3_bucket_inventory": resourceAwsS3BucketInventory(), - "aws_s3control_bucket": resourceAwsS3ControlBucket(), - "aws_s3control_bucket_policy": resourceAwsS3ControlBucketPolicy(), - "aws_s3control_bucket_lifecycle_configuration": resourceAwsS3ControlBucketLifecycleConfiguration(), - "aws_s3outposts_endpoint": resourceAwsS3OutpostsEndpoint(), - "aws_security_group": resourceAwsSecurityGroup(), - "aws_network_interface_sg_attachment": resourceAwsNetworkInterfaceSGAttachment(), - "aws_default_security_group": resourceAwsDefaultSecurityGroup(), - "aws_security_group_rule": resourceAwsSecurityGroupRule(), - "aws_securityhub_account": resourceAwsSecurityHubAccount(), - "aws_securityhub_action_target": resourceAwsSecurityHubActionTarget(), - "aws_securityhub_member": resourceAwsSecurityHubMember(), - "aws_securityhub_product_subscription": resourceAwsSecurityHubProductSubscription(), - "aws_securityhub_standards_subscription": resourceAwsSecurityHubStandardsSubscription(), - "aws_serverlessapplicationrepository_cloudformation_stack": resourceAwsServerlessApplicationRepositoryCloudFormationStack(), - "aws_servicecatalog_portfolio": resourceAwsServiceCatalogPortfolio(), - "aws_service_discovery_http_namespace": resourceAwsServiceDiscoveryHttpNamespace(), - "aws_service_discovery_private_dns_namespace": resourceAwsServiceDiscoveryPrivateDnsNamespace(), - "aws_service_discovery_public_dns_namespace": resourceAwsServiceDiscoveryPublicDnsNamespace(), - "aws_service_discovery_service": resourceAwsServiceDiscoveryService(), - "aws_servicequotas_service_quota": resourceAwsServiceQuotasServiceQuota(), - "aws_shield_protection": resourceAwsShieldProtection(), - "aws_signer_signing_job": resourceAwsSignerSigningJob(), - "aws_signer_signing_profile": resourceAwsSignerSigningProfile(), - "aws_signer_signing_profile_permission": resourceAwsSignerSigningProfilePermission(), - "aws_simpledb_domain": resourceAwsSimpleDBDomain(), - "aws_ssm_activation": resourceAwsSsmActivation(), - "aws_ssm_association": resourceAwsSsmAssociation(), - "aws_ssm_document": resourceAwsSsmDocument(), - "aws_ssm_maintenance_window": resourceAwsSsmMaintenanceWindow(), - "aws_ssm_maintenance_window_target": resourceAwsSsmMaintenanceWindowTarget(), - "aws_ssm_maintenance_window_task": resourceAwsSsmMaintenanceWindowTask(), - "aws_ssm_patch_baseline": resourceAwsSsmPatchBaseline(), - "aws_ssm_patch_group": resourceAwsSsmPatchGroup(), - "aws_ssm_parameter": resourceAwsSsmParameter(), - "aws_ssm_resource_data_sync": resourceAwsSsmResourceDataSync(), - "aws_storagegateway_cache": resourceAwsStorageGatewayCache(), - "aws_storagegateway_cached_iscsi_volume": resourceAwsStorageGatewayCachedIscsiVolume(), - "aws_storagegateway_gateway": resourceAwsStorageGatewayGateway(), - "aws_storagegateway_nfs_file_share": resourceAwsStorageGatewayNfsFileShare(), - "aws_storagegateway_smb_file_share": resourceAwsStorageGatewaySmbFileShare(), - "aws_storagegateway_stored_iscsi_volume": resourceAwsStorageGatewayStoredIscsiVolume(), - "aws_storagegateway_tape_pool": resourceAwsStorageGatewayTapePool(), - "aws_storagegateway_upload_buffer": resourceAwsStorageGatewayUploadBuffer(), - "aws_storagegateway_working_storage": resourceAwsStorageGatewayWorkingStorage(), - "aws_spot_datafeed_subscription": resourceAwsSpotDataFeedSubscription(), - "aws_spot_instance_request": resourceAwsSpotInstanceRequest(), - "aws_spot_fleet_request": resourceAwsSpotFleetRequest(), - "aws_sqs_queue": resourceAwsSqsQueue(), - "aws_sqs_queue_policy": resourceAwsSqsQueuePolicy(), - "aws_snapshot_create_volume_permission": resourceAwsSnapshotCreateVolumePermission(), - "aws_sns_platform_application": resourceAwsSnsPlatformApplication(), - "aws_sns_sms_preferences": resourceAwsSnsSmsPreferences(), - "aws_sns_topic": resourceAwsSnsTopic(), - "aws_sns_topic_policy": resourceAwsSnsTopicPolicy(), - "aws_sns_topic_subscription": resourceAwsSnsTopicSubscription(), - "aws_sfn_activity": resourceAwsSfnActivity(), - "aws_sfn_state_machine": resourceAwsSfnStateMachine(), - "aws_default_subnet": resourceAwsDefaultSubnet(), - "aws_subnet": resourceAwsSubnet(), - "aws_swf_domain": resourceAwsSwfDomain(), - "aws_transfer_server": resourceAwsTransferServer(), - "aws_transfer_ssh_key": resourceAwsTransferSshKey(), - "aws_transfer_user": resourceAwsTransferUser(), - "aws_volume_attachment": resourceAwsVolumeAttachment(), - "aws_vpc_dhcp_options_association": resourceAwsVpcDhcpOptionsAssociation(), - "aws_default_vpc_dhcp_options": resourceAwsDefaultVpcDhcpOptions(), - "aws_vpc_dhcp_options": resourceAwsVpcDhcpOptions(), - "aws_vpc_peering_connection": resourceAwsVpcPeeringConnection(), - "aws_vpc_peering_connection_accepter": resourceAwsVpcPeeringConnectionAccepter(), - "aws_vpc_peering_connection_options": resourceAwsVpcPeeringConnectionOptions(), - "aws_default_vpc": resourceAwsDefaultVpc(), - "aws_vpc": resourceAwsVpc(), - "aws_vpc_endpoint": resourceAwsVpcEndpoint(), - "aws_vpc_endpoint_connection_notification": resourceAwsVpcEndpointConnectionNotification(), - "aws_vpc_endpoint_route_table_association": resourceAwsVpcEndpointRouteTableAssociation(), - "aws_vpc_endpoint_subnet_association": resourceAwsVpcEndpointSubnetAssociation(), - "aws_vpc_endpoint_service": resourceAwsVpcEndpointService(), - "aws_vpc_endpoint_service_allowed_principal": resourceAwsVpcEndpointServiceAllowedPrincipal(), - "aws_vpc_ipv4_cidr_block_association": resourceAwsVpcIpv4CidrBlockAssociation(), - "aws_vpn_connection": resourceAwsVpnConnection(), - "aws_vpn_connection_route": resourceAwsVpnConnectionRoute(), - "aws_vpn_gateway": resourceAwsVpnGateway(), - "aws_vpn_gateway_attachment": resourceAwsVpnGatewayAttachment(), - "aws_vpn_gateway_route_propagation": resourceAwsVpnGatewayRoutePropagation(), - "aws_waf_byte_match_set": resourceAwsWafByteMatchSet(), - "aws_waf_ipset": resourceAwsWafIPSet(), - "aws_waf_rate_based_rule": resourceAwsWafRateBasedRule(), - "aws_waf_regex_match_set": resourceAwsWafRegexMatchSet(), - "aws_waf_regex_pattern_set": resourceAwsWafRegexPatternSet(), - "aws_waf_rule": resourceAwsWafRule(), - "aws_waf_rule_group": resourceAwsWafRuleGroup(), - "aws_waf_size_constraint_set": resourceAwsWafSizeConstraintSet(), - "aws_waf_web_acl": resourceAwsWafWebAcl(), - "aws_waf_xss_match_set": resourceAwsWafXssMatchSet(), - "aws_waf_sql_injection_match_set": resourceAwsWafSqlInjectionMatchSet(), - "aws_waf_geo_match_set": resourceAwsWafGeoMatchSet(), - "aws_wafregional_byte_match_set": resourceAwsWafRegionalByteMatchSet(), - "aws_wafregional_geo_match_set": resourceAwsWafRegionalGeoMatchSet(), - "aws_wafregional_ipset": resourceAwsWafRegionalIPSet(), - "aws_wafregional_rate_based_rule": resourceAwsWafRegionalRateBasedRule(), - "aws_wafregional_regex_match_set": resourceAwsWafRegionalRegexMatchSet(), - "aws_wafregional_regex_pattern_set": resourceAwsWafRegionalRegexPatternSet(), - "aws_wafregional_rule": resourceAwsWafRegionalRule(), - "aws_wafregional_rule_group": resourceAwsWafRegionalRuleGroup(), - "aws_wafregional_size_constraint_set": resourceAwsWafRegionalSizeConstraintSet(), - "aws_wafregional_sql_injection_match_set": resourceAwsWafRegionalSqlInjectionMatchSet(), - "aws_wafregional_xss_match_set": resourceAwsWafRegionalXssMatchSet(), - "aws_wafregional_web_acl": resourceAwsWafRegionalWebAcl(), - "aws_wafregional_web_acl_association": resourceAwsWafRegionalWebAclAssociation(), - "aws_wafv2_ip_set": resourceAwsWafv2IPSet(), - "aws_wafv2_regex_pattern_set": resourceAwsWafv2RegexPatternSet(), - "aws_wafv2_rule_group": resourceAwsWafv2RuleGroup(), - "aws_wafv2_web_acl": resourceAwsWafv2WebACL(), - "aws_wafv2_web_acl_association": resourceAwsWafv2WebACLAssociation(), - "aws_wafv2_web_acl_logging_configuration": resourceAwsWafv2WebACLLoggingConfiguration(), - "aws_worklink_fleet": resourceAwsWorkLinkFleet(), - "aws_worklink_website_certificate_authority_association": resourceAwsWorkLinkWebsiteCertificateAuthorityAssociation(), - "aws_workspaces_directory": resourceAwsWorkspacesDirectory(), - "aws_workspaces_workspace": resourceAwsWorkspacesWorkspace(), - "aws_batch_compute_environment": resourceAwsBatchComputeEnvironment(), - "aws_batch_job_definition": resourceAwsBatchJobDefinition(), - "aws_batch_job_queue": resourceAwsBatchJobQueue(), - "aws_pinpoint_app": resourceAwsPinpointApp(), - "aws_pinpoint_adm_channel": resourceAwsPinpointADMChannel(), - "aws_pinpoint_apns_channel": resourceAwsPinpointAPNSChannel(), - "aws_pinpoint_apns_sandbox_channel": resourceAwsPinpointAPNSSandboxChannel(), - "aws_pinpoint_apns_voip_channel": resourceAwsPinpointAPNSVoipChannel(), - "aws_pinpoint_apns_voip_sandbox_channel": resourceAwsPinpointAPNSVoipSandboxChannel(), - "aws_pinpoint_baidu_channel": resourceAwsPinpointBaiduChannel(), - "aws_pinpoint_email_channel": resourceAwsPinpointEmailChannel(), - "aws_pinpoint_event_stream": resourceAwsPinpointEventStream(), - "aws_pinpoint_gcm_channel": resourceAwsPinpointGCMChannel(), - "aws_pinpoint_sms_channel": resourceAwsPinpointSMSChannel(), - "aws_xray_encryption_config": resourceAwsXrayEncryptionConfig(), - "aws_xray_group": resourceAwsXrayGroup(), - "aws_xray_sampling_rule": resourceAwsXraySamplingRule(), - "aws_workspaces_ip_group": resourceAwsWorkspacesIpGroup(), + "aws_accessanalyzer_analyzer": resourceAwsAccessAnalyzerAnalyzer(), + "aws_acm_certificate": resourceAwsAcmCertificate(), + "aws_acm_certificate_validation": resourceAwsAcmCertificateValidation(), + "aws_acmpca_certificate_authority": resourceAwsAcmpcaCertificateAuthority(), + "aws_ami": resourceAwsAmi(), + "aws_ami_copy": resourceAwsAmiCopy(), + "aws_ami_from_instance": resourceAwsAmiFromInstance(), + "aws_ami_launch_permission": resourceAwsAmiLaunchPermission(), + "aws_api_gateway_account": resourceAwsApiGatewayAccount(), + "aws_api_gateway_api_key": resourceAwsApiGatewayApiKey(), + "aws_api_gateway_authorizer": resourceAwsApiGatewayAuthorizer(), + "aws_api_gateway_base_path_mapping": resourceAwsApiGatewayBasePathMapping(), + "aws_api_gateway_client_certificate": resourceAwsApiGatewayClientCertificate(), + "aws_api_gateway_deployment": resourceAwsApiGatewayDeployment(), + "aws_api_gateway_documentation_part": resourceAwsApiGatewayDocumentationPart(), + "aws_api_gateway_documentation_version": resourceAwsApiGatewayDocumentationVersion(), + "aws_api_gateway_domain_name": resourceAwsApiGatewayDomainName(), + "aws_api_gateway_gateway_response": resourceAwsApiGatewayGatewayResponse(), + "aws_api_gateway_integration": resourceAwsApiGatewayIntegration(), + "aws_api_gateway_integration_response": resourceAwsApiGatewayIntegrationResponse(), + "aws_api_gateway_method": resourceAwsApiGatewayMethod(), + "aws_api_gateway_method_response": resourceAwsApiGatewayMethodResponse(), + "aws_api_gateway_method_settings": resourceAwsApiGatewayMethodSettings(), + "aws_api_gateway_model": resourceAwsApiGatewayModel(), + "aws_api_gateway_request_validator": resourceAwsApiGatewayRequestValidator(), + "aws_api_gateway_resource": resourceAwsApiGatewayResource(), + "aws_api_gateway_rest_api": resourceAwsApiGatewayRestApi(), + "aws_api_gateway_rest_api_policy": resourceAwsApiGatewayRestApiPolicy(), + "aws_api_gateway_stage": resourceAwsApiGatewayStage(), + "aws_api_gateway_usage_plan": resourceAwsApiGatewayUsagePlan(), + "aws_api_gateway_usage_plan_key": resourceAwsApiGatewayUsagePlanKey(), + "aws_api_gateway_vpc_link": resourceAwsApiGatewayVpcLink(), + "aws_apigatewayv2_api": resourceAwsApiGatewayV2Api(), + "aws_apigatewayv2_api_mapping": resourceAwsApiGatewayV2ApiMapping(), + "aws_apigatewayv2_authorizer": resourceAwsApiGatewayV2Authorizer(), + "aws_apigatewayv2_deployment": resourceAwsApiGatewayV2Deployment(), + "aws_apigatewayv2_domain_name": resourceAwsApiGatewayV2DomainName(), + "aws_apigatewayv2_integration": resourceAwsApiGatewayV2Integration(), + "aws_apigatewayv2_integration_response": resourceAwsApiGatewayV2IntegrationResponse(), + "aws_apigatewayv2_model": resourceAwsApiGatewayV2Model(), + "aws_apigatewayv2_route": resourceAwsApiGatewayV2Route(), + "aws_apigatewayv2_route_response": resourceAwsApiGatewayV2RouteResponse(), + "aws_apigatewayv2_stage": resourceAwsApiGatewayV2Stage(), + "aws_apigatewayv2_vpc_link": resourceAwsApiGatewayV2VpcLink(), + "aws_app_cookie_stickiness_policy": resourceAwsAppCookieStickinessPolicy(), + "aws_appautoscaling_target": resourceAwsAppautoscalingTarget(), + "aws_appautoscaling_policy": resourceAwsAppautoscalingPolicy(), + "aws_appautoscaling_scheduled_action": resourceAwsAppautoscalingScheduledAction(), + "aws_appmesh_gateway_route": resourceAwsAppmeshGatewayRoute(), + "aws_appmesh_mesh": resourceAwsAppmeshMesh(), + "aws_appmesh_route": resourceAwsAppmeshRoute(), + "aws_appmesh_virtual_gateway": resourceAwsAppmeshVirtualGateway(), + "aws_appmesh_virtual_node": resourceAwsAppmeshVirtualNode(), + "aws_appmesh_virtual_router": resourceAwsAppmeshVirtualRouter(), + "aws_appmesh_virtual_service": resourceAwsAppmeshVirtualService(), + "aws_appsync_api_key": resourceAwsAppsyncApiKey(), + "aws_appsync_datasource": resourceAwsAppsyncDatasource(), + "aws_appsync_function": resourceAwsAppsyncFunction(), + "aws_appsync_graphql_api": resourceAwsAppsyncGraphqlApi(), + "aws_appsync_resolver": resourceAwsAppsyncResolver(), + "aws_athena_database": resourceAwsAthenaDatabase(), + "aws_athena_named_query": resourceAwsAthenaNamedQuery(), + "aws_athena_workgroup": resourceAwsAthenaWorkgroup(), + "aws_autoscaling_attachment": resourceAwsAutoscalingAttachment(), + "aws_autoscaling_group": resourceAwsAutoscalingGroup(), + "aws_autoscaling_lifecycle_hook": resourceAwsAutoscalingLifecycleHook(), + "aws_autoscaling_notification": resourceAwsAutoscalingNotification(), + "aws_autoscaling_policy": resourceAwsAutoscalingPolicy(), + "aws_autoscaling_schedule": resourceAwsAutoscalingSchedule(), + "aws_autoscalingplans_scaling_plan": resourceAwsAutoScalingPlansScalingPlan(), + "aws_backup_plan": resourceAwsBackupPlan(), + "aws_backup_selection": resourceAwsBackupSelection(), + "aws_backup_vault": resourceAwsBackupVault(), + "aws_backup_vault_notifications": resourceAwsBackupVaultNotifications(), + "aws_backup_vault_policy": resourceAwsBackupVaultPolicy(), + "aws_budgets_budget": resourceAwsBudgetsBudget(), + "aws_cloud9_environment_ec2": resourceAwsCloud9EnvironmentEc2(), + "aws_cloudformation_stack": resourceAwsCloudFormationStack(), + "aws_cloudformation_stack_set": resourceAwsCloudFormationStackSet(), + "aws_cloudformation_stack_set_instance": resourceAwsCloudFormationStackSetInstance(), + "aws_cloudfront_distribution": resourceAwsCloudFrontDistribution(), + "aws_cloudfront_origin_access_identity": resourceAwsCloudFrontOriginAccessIdentity(), + "aws_cloudfront_public_key": resourceAwsCloudFrontPublicKey(), + "aws_cloudtrail": resourceAwsCloudTrail(), + "aws_cloudwatch_event_bus": resourceAwsCloudWatchEventBus(), + "aws_cloudwatch_event_permission": resourceAwsCloudWatchEventPermission(), + "aws_cloudwatch_event_rule": resourceAwsCloudWatchEventRule(), + "aws_cloudwatch_event_target": resourceAwsCloudWatchEventTarget(), + "aws_cloudwatch_log_destination": resourceAwsCloudWatchLogDestination(), + "aws_cloudwatch_log_destination_policy": resourceAwsCloudWatchLogDestinationPolicy(), + "aws_cloudwatch_log_group": resourceAwsCloudWatchLogGroup(), + "aws_cloudwatch_log_metric_filter": resourceAwsCloudWatchLogMetricFilter(), + "aws_cloudwatch_log_resource_policy": resourceAwsCloudWatchLogResourcePolicy(), + "aws_cloudwatch_log_stream": resourceAwsCloudWatchLogStream(), + "aws_cloudwatch_log_subscription_filter": resourceAwsCloudwatchLogSubscriptionFilter(), + "aws_config_aggregate_authorization": resourceAwsConfigAggregateAuthorization(), + "aws_config_config_rule": resourceAwsConfigConfigRule(), + "aws_config_configuration_aggregator": resourceAwsConfigConfigurationAggregator(), + "aws_config_configuration_recorder": resourceAwsConfigConfigurationRecorder(), + "aws_config_configuration_recorder_status": resourceAwsConfigConfigurationRecorderStatus(), + "aws_config_delivery_channel": resourceAwsConfigDeliveryChannel(), + "aws_config_organization_custom_rule": resourceAwsConfigOrganizationCustomRule(), + "aws_config_organization_managed_rule": resourceAwsConfigOrganizationManagedRule(), + "aws_config_remediation_configuration": resourceAwsConfigRemediationConfiguration(), + "aws_cognito_identity_pool": resourceAwsCognitoIdentityPool(), + "aws_cognito_identity_pool_roles_attachment": resourceAwsCognitoIdentityPoolRolesAttachment(), + "aws_cognito_identity_provider": resourceAwsCognitoIdentityProvider(), + "aws_cognito_user_group": resourceAwsCognitoUserGroup(), + "aws_cognito_user_pool": resourceAwsCognitoUserPool(), + "aws_cognito_user_pool_client": resourceAwsCognitoUserPoolClient(), + "aws_cognito_user_pool_domain": resourceAwsCognitoUserPoolDomain(), + "aws_cloudhsm_v2_cluster": resourceAwsCloudHsmV2Cluster(), + "aws_cloudhsm_v2_hsm": resourceAwsCloudHsmV2Hsm(), + "aws_cognito_resource_server": resourceAwsCognitoResourceServer(), + "aws_cloudwatch_metric_alarm": resourceAwsCloudWatchMetricAlarm(), + "aws_cloudwatch_dashboard": resourceAwsCloudWatchDashboard(), + "aws_codedeploy_app": resourceAwsCodeDeployApp(), + "aws_codedeploy_deployment_config": resourceAwsCodeDeployDeploymentConfig(), + "aws_codedeploy_deployment_group": resourceAwsCodeDeployDeploymentGroup(), + "aws_codecommit_repository": resourceAwsCodeCommitRepository(), + "aws_codecommit_trigger": resourceAwsCodeCommitTrigger(), + "aws_codeartifact_domain": resourceAwsCodeArtifactDomain(), + "aws_codeartifact_domain_permissions_policy": resourceAwsCodeArtifactDomainPermissionsPolicy(), + "aws_codeartifact_repository": resourceAwsCodeArtifactRepository(), + "aws_codeartifact_repository_permissions_policy": resourceAwsCodeArtifactRepositoryPermissionsPolicy(), + "aws_codebuild_project": resourceAwsCodeBuildProject(), + "aws_codebuild_report_group": resourceAwsCodeBuildReportGroup(), + "aws_codebuild_source_credential": resourceAwsCodeBuildSourceCredential(), + "aws_codebuild_webhook": resourceAwsCodeBuildWebhook(), + "aws_codepipeline": resourceAwsCodePipeline(), + "aws_codepipeline_webhook": resourceAwsCodePipelineWebhook(), + "aws_codestarnotifications_notification_rule": resourceAwsCodeStarNotificationsNotificationRule(), + "aws_cur_report_definition": resourceAwsCurReportDefinition(), + "aws_customer_gateway": resourceAwsCustomerGateway(), + "aws_datapipeline_pipeline": resourceAwsDataPipelinePipeline(), + "aws_datasync_agent": resourceAwsDataSyncAgent(), + "aws_datasync_location_efs": resourceAwsDataSyncLocationEfs(), + "aws_datasync_location_fsx_windows_file_system": resourceAwsDataSyncLocationFsxWindowsFileSystem(), + "aws_datasync_location_nfs": resourceAwsDataSyncLocationNfs(), + "aws_datasync_location_s3": resourceAwsDataSyncLocationS3(), + "aws_datasync_location_smb": resourceAwsDataSyncLocationSmb(), + "aws_datasync_task": resourceAwsDataSyncTask(), + "aws_dax_cluster": resourceAwsDaxCluster(), + "aws_dax_parameter_group": resourceAwsDaxParameterGroup(), + "aws_dax_subnet_group": resourceAwsDaxSubnetGroup(), + "aws_db_cluster_snapshot": resourceAwsDbClusterSnapshot(), + "aws_db_event_subscription": resourceAwsDbEventSubscription(), + "aws_db_instance": resourceAwsDbInstance(), + "aws_db_instance_role_association": resourceAwsDbInstanceRoleAssociation(), + "aws_db_option_group": resourceAwsDbOptionGroup(), + "aws_db_parameter_group": resourceAwsDbParameterGroup(), + "aws_db_proxy": resourceAwsDbProxy(), + "aws_db_proxy_default_target_group": resourceAwsDbProxyDefaultTargetGroup(), + "aws_db_proxy_target": resourceAwsDbProxyTarget(), + "aws_db_security_group": resourceAwsDbSecurityGroup(), + "aws_db_snapshot": resourceAwsDbSnapshot(), + "aws_db_subnet_group": resourceAwsDbSubnetGroup(), + "aws_devicefarm_project": resourceAwsDevicefarmProject(), + "aws_directory_service_directory": resourceAwsDirectoryServiceDirectory(), + "aws_directory_service_conditional_forwarder": resourceAwsDirectoryServiceConditionalForwarder(), + "aws_directory_service_log_subscription": resourceAwsDirectoryServiceLogSubscription(), + "aws_dlm_lifecycle_policy": resourceAwsDlmLifecyclePolicy(), + "aws_dms_certificate": resourceAwsDmsCertificate(), + "aws_dms_endpoint": resourceAwsDmsEndpoint(), + "aws_dms_event_subscription": resourceAwsDmsEventSubscription(), + "aws_dms_replication_instance": resourceAwsDmsReplicationInstance(), + "aws_dms_replication_subnet_group": resourceAwsDmsReplicationSubnetGroup(), + "aws_dms_replication_task": resourceAwsDmsReplicationTask(), + "aws_docdb_cluster": resourceAwsDocDBCluster(), + "aws_docdb_cluster_instance": resourceAwsDocDBClusterInstance(), + "aws_docdb_cluster_parameter_group": resourceAwsDocDBClusterParameterGroup(), + "aws_docdb_cluster_snapshot": resourceAwsDocDBClusterSnapshot(), + "aws_docdb_subnet_group": resourceAwsDocDBSubnetGroup(), + "aws_dx_bgp_peer": resourceAwsDxBgpPeer(), + "aws_dx_connection": resourceAwsDxConnection(), + "aws_dx_connection_association": resourceAwsDxConnectionAssociation(), + "aws_dx_gateway": resourceAwsDxGateway(), + "aws_dx_gateway_association": resourceAwsDxGatewayAssociation(), + "aws_dx_gateway_association_proposal": resourceAwsDxGatewayAssociationProposal(), + "aws_dx_hosted_private_virtual_interface": resourceAwsDxHostedPrivateVirtualInterface(), + "aws_dx_hosted_private_virtual_interface_accepter": resourceAwsDxHostedPrivateVirtualInterfaceAccepter(), + "aws_dx_hosted_public_virtual_interface": resourceAwsDxHostedPublicVirtualInterface(), + "aws_dx_hosted_public_virtual_interface_accepter": resourceAwsDxHostedPublicVirtualInterfaceAccepter(), + "aws_dx_hosted_transit_virtual_interface": resourceAwsDxHostedTransitVirtualInterface(), + "aws_dx_hosted_transit_virtual_interface_accepter": resourceAwsDxHostedTransitVirtualInterfaceAccepter(), + "aws_dx_lag": resourceAwsDxLag(), + "aws_dx_private_virtual_interface": resourceAwsDxPrivateVirtualInterface(), + "aws_dx_public_virtual_interface": resourceAwsDxPublicVirtualInterface(), + "aws_dx_transit_virtual_interface": resourceAwsDxTransitVirtualInterface(), + "aws_dynamodb_table": resourceAwsDynamoDbTable(), + "aws_dynamodb_table_item": resourceAwsDynamoDbTableItem(), + "aws_dynamodb_global_table": resourceAwsDynamoDbGlobalTable(), + "aws_ebs_default_kms_key": resourceAwsEbsDefaultKmsKey(), + "aws_ebs_encryption_by_default": resourceAwsEbsEncryptionByDefault(), + "aws_ebs_snapshot": resourceAwsEbsSnapshot(), + "aws_ebs_snapshot_copy": resourceAwsEbsSnapshotCopy(), + "aws_ebs_volume": resourceAwsEbsVolume(), + "aws_ec2_availability_zone_group": resourceAwsEc2AvailabilityZoneGroup(), + "aws_ec2_capacity_reservation": resourceAwsEc2CapacityReservation(), + "aws_ec2_client_vpn_authorization_rule": resourceAwsEc2ClientVpnAuthorizationRule(), + "aws_ec2_client_vpn_endpoint": resourceAwsEc2ClientVpnEndpoint(), + "aws_ec2_client_vpn_network_association": resourceAwsEc2ClientVpnNetworkAssociation(), + "aws_ec2_client_vpn_route": resourceAwsEc2ClientVpnRoute(), + "aws_ec2_fleet": resourceAwsEc2Fleet(), + "aws_ec2_local_gateway_route": resourceAwsEc2LocalGatewayRoute(), + "aws_ec2_local_gateway_route_table_vpc_association": resourceAwsEc2LocalGatewayRouteTableVpcAssociation(), + "aws_ec2_tag": resourceAwsEc2Tag(), + "aws_ec2_traffic_mirror_filter": resourceAwsEc2TrafficMirrorFilter(), + "aws_ec2_traffic_mirror_filter_rule": resourceAwsEc2TrafficMirrorFilterRule(), + "aws_ec2_traffic_mirror_target": resourceAwsEc2TrafficMirrorTarget(), + "aws_ec2_traffic_mirror_session": resourceAwsEc2TrafficMirrorSession(), + "aws_ec2_transit_gateway": resourceAwsEc2TransitGateway(), + "aws_ec2_transit_gateway_peering_attachment": resourceAwsEc2TransitGatewayPeeringAttachment(), + "aws_ec2_transit_gateway_peering_attachment_accepter": resourceAwsEc2TransitGatewayPeeringAttachmentAccepter(), + "aws_ec2_transit_gateway_route": resourceAwsEc2TransitGatewayRoute(), + "aws_ec2_transit_gateway_route_table": resourceAwsEc2TransitGatewayRouteTable(), + "aws_ec2_transit_gateway_route_table_association": resourceAwsEc2TransitGatewayRouteTableAssociation(), + "aws_ec2_transit_gateway_route_table_propagation": resourceAwsEc2TransitGatewayRouteTablePropagation(), + "aws_ec2_transit_gateway_vpc_attachment": resourceAwsEc2TransitGatewayVpcAttachment(), + "aws_ec2_transit_gateway_vpc_attachment_accepter": resourceAwsEc2TransitGatewayVpcAttachmentAccepter(), + "aws_ecr_lifecycle_policy": resourceAwsEcrLifecyclePolicy(), + "aws_ecr_repository": resourceAwsEcrRepository(), + "aws_ecr_repository_policy": resourceAwsEcrRepositoryPolicy(), + "aws_ecs_capacity_provider": resourceAwsEcsCapacityProvider(), + "aws_ecs_cluster": resourceAwsEcsCluster(), + "aws_ecs_service": resourceAwsEcsService(), + "aws_ecs_task_definition": resourceAwsEcsTaskDefinition(), + "aws_efs_access_point": resourceAwsEfsAccessPoint(), + "aws_efs_file_system": resourceAwsEfsFileSystem(), + "aws_efs_file_system_policy": resourceAwsEfsFileSystemPolicy(), + "aws_efs_mount_target": resourceAwsEfsMountTarget(), + "aws_egress_only_internet_gateway": resourceAwsEgressOnlyInternetGateway(), + "aws_eip": resourceAwsEip(), + "aws_eip_association": resourceAwsEipAssociation(), + "aws_eks_cluster": resourceAwsEksCluster(), + "aws_eks_fargate_profile": resourceAwsEksFargateProfile(), + "aws_eks_node_group": resourceAwsEksNodeGroup(), + "aws_elasticache_cluster": resourceAwsElasticacheCluster(), + "aws_elasticache_parameter_group": resourceAwsElasticacheParameterGroup(), + "aws_elasticache_replication_group": resourceAwsElasticacheReplicationGroup(), + "aws_elasticache_security_group": resourceAwsElasticacheSecurityGroup(), + "aws_elasticache_subnet_group": resourceAwsElasticacheSubnetGroup(), + "aws_elastic_beanstalk_application": resourceAwsElasticBeanstalkApplication(), + "aws_elastic_beanstalk_application_version": resourceAwsElasticBeanstalkApplicationVersion(), + "aws_elastic_beanstalk_configuration_template": resourceAwsElasticBeanstalkConfigurationTemplate(), + "aws_elastic_beanstalk_environment": resourceAwsElasticBeanstalkEnvironment(), + "aws_elasticsearch_domain": resourceAwsElasticSearchDomain(), + "aws_elasticsearch_domain_policy": resourceAwsElasticSearchDomainPolicy(), + "aws_elastictranscoder_pipeline": resourceAwsElasticTranscoderPipeline(), + "aws_elastictranscoder_preset": resourceAwsElasticTranscoderPreset(), + "aws_elb": resourceAwsElb(), + "aws_elb_attachment": resourceAwsElbAttachment(), + "aws_emr_cluster": resourceAwsEMRCluster(), + "aws_emr_instance_group": resourceAwsEMRInstanceGroup(), + "aws_emr_instance_fleet": resourceAwsEMRInstanceFleet(), + "aws_emr_managed_scaling_policy": resourceAwsEMRManagedScalingPolicy(), + "aws_emr_security_configuration": resourceAwsEMRSecurityConfiguration(), + "aws_flow_log": resourceAwsFlowLog(), + "aws_fsx_lustre_file_system": resourceAwsFsxLustreFileSystem(), + "aws_fsx_windows_file_system": resourceAwsFsxWindowsFileSystem(), + "aws_fms_admin_account": resourceAwsFmsAdminAccount(), + "aws_gamelift_alias": resourceAwsGameliftAlias(), + "aws_gamelift_build": resourceAwsGameliftBuild(), + "aws_gamelift_fleet": resourceAwsGameliftFleet(), + "aws_gamelift_game_session_queue": resourceAwsGameliftGameSessionQueue(), + "aws_glacier_vault": resourceAwsGlacierVault(), + "aws_glacier_vault_lock": resourceAwsGlacierVaultLock(), + "aws_globalaccelerator_accelerator": resourceAwsGlobalAcceleratorAccelerator(), + "aws_globalaccelerator_endpoint_group": resourceAwsGlobalAcceleratorEndpointGroup(), + "aws_globalaccelerator_listener": resourceAwsGlobalAcceleratorListener(), + "aws_glue_catalog_database": resourceAwsGlueCatalogDatabase(), + "aws_glue_catalog_table": resourceAwsGlueCatalogTable(), + "aws_glue_classifier": resourceAwsGlueClassifier(), + "aws_glue_connection": resourceAwsGlueConnection(), + "aws_glue_dev_endpoint": resourceAwsGlueDevEndpoint(), + "aws_glue_crawler": resourceAwsGlueCrawler(), + "aws_glue_data_catalog_encryption_settings": resourceAwsGlueDataCatalogEncryptionSettings(), + "aws_glue_job": resourceAwsGlueJob(), + "aws_glue_ml_transform": resourceAwsGlueMLTransform(), + "aws_glue_partition": resourceAwsGluePartition(), + "aws_glue_security_configuration": resourceAwsGlueSecurityConfiguration(), + "aws_glue_trigger": resourceAwsGlueTrigger(), + "aws_glue_user_defined_function": resourceAwsGlueUserDefinedFunction(), + "aws_glue_workflow": resourceAwsGlueWorkflow(), + "aws_glue_resource_policy": resourceAwsGlueResourcePolicy(), + "aws_guardduty_detector": resourceAwsGuardDutyDetector(), + "aws_guardduty_filter": resourceAwsGuardDutyFilter(), + "aws_guardduty_invite_accepter": resourceAwsGuardDutyInviteAccepter(), + "aws_guardduty_ipset": resourceAwsGuardDutyIpset(), + "aws_guardduty_member": resourceAwsGuardDutyMember(), + "aws_guardduty_organization_admin_account": resourceAwsGuardDutyOrganizationAdminAccount(), + "aws_guardduty_organization_configuration": resourceAwsGuardDutyOrganizationConfiguration(), + "aws_guardduty_publishing_destination": resourceAwsGuardDutyPublishingDestination(), + "aws_guardduty_threatintelset": resourceAwsGuardDutyThreatintelset(), + "aws_iam_access_key": resourceAwsIamAccessKey(), + "aws_iam_account_alias": resourceAwsIamAccountAlias(), + "aws_iam_account_password_policy": resourceAwsIamAccountPasswordPolicy(), + "aws_iam_group_policy": resourceAwsIamGroupPolicy(), + "aws_iam_group": resourceAwsIamGroup(), + "aws_iam_group_membership": resourceAwsIamGroupMembership(), + "aws_iam_group_policy_attachment": resourceAwsIamGroupPolicyAttachment(), + "aws_iam_instance_profile": resourceAwsIamInstanceProfile(), + "aws_iam_openid_connect_provider": resourceAwsIamOpenIDConnectProvider(), + "aws_iam_policy": resourceAwsIamPolicy(), + "aws_iam_policy_attachment": resourceAwsIamPolicyAttachment(), + "aws_iam_role_policy_attachment": resourceAwsIamRolePolicyAttachment(), + "aws_iam_role_policy": resourceAwsIamRolePolicy(), + "aws_iam_role": resourceAwsIamRole(), + "aws_iam_saml_provider": resourceAwsIamSamlProvider(), + "aws_iam_server_certificate": resourceAwsIAMServerCertificate(), + "aws_iam_service_linked_role": resourceAwsIamServiceLinkedRole(), + "aws_iam_user_group_membership": resourceAwsIamUserGroupMembership(), + "aws_iam_user_policy_attachment": resourceAwsIamUserPolicyAttachment(), + "aws_iam_user_policy": resourceAwsIamUserPolicy(), + "aws_iam_user_ssh_key": resourceAwsIamUserSshKey(), + "aws_iam_user": resourceAwsIamUser(), + "aws_iam_user_login_profile": resourceAwsIamUserLoginProfile(), + "aws_imagebuilder_component": resourceAwsImageBuilderComponent(), + "aws_imagebuilder_distribution_configuration": resourceAwsImageBuilderDistributionConfiguration(), + "aws_imagebuilder_image_recipe": resourceAwsImageBuilderImageRecipe(), + "aws_imagebuilder_infrastructure_configuration": resourceAwsImageBuilderInfrastructureConfiguration(), + "aws_inspector_assessment_target": resourceAWSInspectorAssessmentTarget(), + "aws_inspector_assessment_template": resourceAWSInspectorAssessmentTemplate(), + "aws_inspector_resource_group": resourceAWSInspectorResourceGroup(), + "aws_instance": resourceAwsInstance(), + "aws_internet_gateway": resourceAwsInternetGateway(), + "aws_iot_certificate": resourceAwsIotCertificate(), + "aws_iot_policy": resourceAwsIotPolicy(), + "aws_iot_policy_attachment": resourceAwsIotPolicyAttachment(), + "aws_iot_thing": resourceAwsIotThing(), + "aws_iot_thing_principal_attachment": resourceAwsIotThingPrincipalAttachment(), + "aws_iot_thing_type": resourceAwsIotThingType(), + "aws_iot_topic_rule": resourceAwsIotTopicRule(), + "aws_iot_role_alias": resourceAwsIotRoleAlias(), + "aws_key_pair": resourceAwsKeyPair(), + "aws_kinesis_analytics_application": resourceAwsKinesisAnalyticsApplication(), + "aws_kinesisanalyticsv2_application": resourceAwsKinesisAnalyticsV2Application(), + "aws_kinesis_firehose_delivery_stream": resourceAwsKinesisFirehoseDeliveryStream(), + "aws_kinesis_stream": resourceAwsKinesisStream(), + "aws_kinesis_video_stream": resourceAwsKinesisVideoStream(), + "aws_kms_alias": resourceAwsKmsAlias(), + "aws_kms_external_key": resourceAwsKmsExternalKey(), + "aws_kms_grant": resourceAwsKmsGrant(), + "aws_kms_key": resourceAwsKmsKey(), + "aws_kms_ciphertext": resourceAwsKmsCiphertext(), + "aws_lambda_alias": resourceAwsLambdaAlias(), + "aws_lambda_code_signing_config": resourceAwsLambdaCodeSigningConfig(), + "aws_lambda_event_source_mapping": resourceAwsLambdaEventSourceMapping(), + "aws_lambda_function_event_invoke_config": resourceAwsLambdaFunctionEventInvokeConfig(), + "aws_lambda_function": resourceAwsLambdaFunction(), + "aws_lambda_layer_version": resourceAwsLambdaLayerVersion(), + "aws_lambda_permission": resourceAwsLambdaPermission(), + "aws_lambda_provisioned_concurrency_config": resourceAwsLambdaProvisionedConcurrencyConfig(), + "aws_launch_configuration": resourceAwsLaunchConfiguration(), + "aws_launch_template": resourceAwsLaunchTemplate(), + "aws_lex_bot": resourceAwsLexBot(), + "aws_lex_bot_alias": resourceAwsLexBotAlias(), + "aws_lex_intent": resourceAwsLexIntent(), + "aws_lex_slot_type": resourceAwsLexSlotType(), + "aws_licensemanager_association": resourceAwsLicenseManagerAssociation(), + "aws_licensemanager_license_configuration": resourceAwsLicenseManagerLicenseConfiguration(), + "aws_lightsail_domain": resourceAwsLightsailDomain(), + "aws_lightsail_instance": resourceAwsLightsailInstance(), + "aws_lightsail_key_pair": resourceAwsLightsailKeyPair(), + "aws_lightsail_static_ip": resourceAwsLightsailStaticIp(), + "aws_lightsail_static_ip_attachment": resourceAwsLightsailStaticIpAttachment(), + "aws_lb_cookie_stickiness_policy": resourceAwsLBCookieStickinessPolicy(), + "aws_load_balancer_policy": resourceAwsLoadBalancerPolicy(), + "aws_load_balancer_backend_server_policy": resourceAwsLoadBalancerBackendServerPolicies(), + "aws_load_balancer_listener_policy": resourceAwsLoadBalancerListenerPolicies(), + "aws_lb_ssl_negotiation_policy": resourceAwsLBSSLNegotiationPolicy(), + "aws_macie_member_account_association": resourceAwsMacieMemberAccountAssociation(), + "aws_macie_s3_bucket_association": resourceAwsMacieS3BucketAssociation(), + "aws_main_route_table_association": resourceAwsMainRouteTableAssociation(), + "aws_mq_broker": resourceAwsMqBroker(), + "aws_mq_configuration": resourceAwsMqConfiguration(), + "aws_media_convert_queue": resourceAwsMediaConvertQueue(), + "aws_media_package_channel": resourceAwsMediaPackageChannel(), + "aws_media_store_container": resourceAwsMediaStoreContainer(), + "aws_media_store_container_policy": resourceAwsMediaStoreContainerPolicy(), + "aws_msk_cluster": resourceAwsMskCluster(), + "aws_msk_configuration": resourceAwsMskConfiguration(), + "aws_nat_gateway": resourceAwsNatGateway(), + "aws_network_acl": resourceAwsNetworkAcl(), + "aws_default_network_acl": resourceAwsDefaultNetworkAcl(), + "aws_neptune_cluster": resourceAwsNeptuneCluster(), + "aws_neptune_cluster_instance": resourceAwsNeptuneClusterInstance(), + "aws_neptune_cluster_parameter_group": resourceAwsNeptuneClusterParameterGroup(), + "aws_neptune_cluster_snapshot": resourceAwsNeptuneClusterSnapshot(), + "aws_neptune_event_subscription": resourceAwsNeptuneEventSubscription(), + "aws_neptune_parameter_group": resourceAwsNeptuneParameterGroup(), + "aws_neptune_subnet_group": resourceAwsNeptuneSubnetGroup(), + "aws_network_acl_rule": resourceAwsNetworkAclRule(), + "aws_network_interface": resourceAwsNetworkInterface(), + "aws_network_interface_attachment": resourceAwsNetworkInterfaceAttachment(), + "aws_networkfirewall_firewall": resourceAwsNetworkFirewallFirewall(), + "aws_networkfirewall_firewall_policy": resourceAwsNetworkFirewallFirewallPolicy(), + "aws_networkfirewall_logging_configuration": resourceAwsNetworkFirewallLoggingConfiguration(), + "aws_networkfirewall_rule_group": resourceAwsNetworkFirewallRuleGroup(), + "aws_opsworks_application": resourceAwsOpsworksApplication(), + "aws_opsworks_stack": resourceAwsOpsworksStack(), + "aws_opsworks_java_app_layer": resourceAwsOpsworksJavaAppLayer(), + "aws_opsworks_haproxy_layer": resourceAwsOpsworksHaproxyLayer(), + "aws_opsworks_static_web_layer": resourceAwsOpsworksStaticWebLayer(), + "aws_opsworks_php_app_layer": resourceAwsOpsworksPhpAppLayer(), + "aws_opsworks_rails_app_layer": resourceAwsOpsworksRailsAppLayer(), + "aws_opsworks_nodejs_app_layer": resourceAwsOpsworksNodejsAppLayer(), + "aws_opsworks_memcached_layer": resourceAwsOpsworksMemcachedLayer(), + "aws_opsworks_mysql_layer": resourceAwsOpsworksMysqlLayer(), + "aws_opsworks_ganglia_layer": resourceAwsOpsworksGangliaLayer(), + "aws_opsworks_custom_layer": resourceAwsOpsworksCustomLayer(), + "aws_opsworks_instance": resourceAwsOpsworksInstance(), + "aws_opsworks_user_profile": resourceAwsOpsworksUserProfile(), + "aws_opsworks_permission": resourceAwsOpsworksPermission(), + "aws_opsworks_rds_db_instance": resourceAwsOpsworksRdsDbInstance(), + "aws_organizations_organization": resourceAwsOrganizationsOrganization(), + "aws_organizations_account": resourceAwsOrganizationsAccount(), + "aws_organizations_policy": resourceAwsOrganizationsPolicy(), + "aws_organizations_policy_attachment": resourceAwsOrganizationsPolicyAttachment(), + "aws_organizations_organizational_unit": resourceAwsOrganizationsOrganizationalUnit(), + "aws_placement_group": resourceAwsPlacementGroup(), + "aws_proxy_protocol_policy": resourceAwsProxyProtocolPolicy(), + "aws_qldb_ledger": resourceAwsQLDBLedger(), + "aws_quicksight_group": resourceAwsQuickSightGroup(), + "aws_quicksight_user": resourceAwsQuickSightUser(), + "aws_ram_principal_association": resourceAwsRamPrincipalAssociation(), + "aws_ram_resource_association": resourceAwsRamResourceAssociation(), + "aws_ram_resource_share": resourceAwsRamResourceShare(), + "aws_ram_resource_share_accepter": resourceAwsRamResourceShareAccepter(), + "aws_rds_cluster": resourceAwsRDSCluster(), + "aws_rds_cluster_endpoint": resourceAwsRDSClusterEndpoint(), + "aws_rds_cluster_instance": resourceAwsRDSClusterInstance(), + "aws_rds_cluster_parameter_group": resourceAwsRDSClusterParameterGroup(), + "aws_rds_global_cluster": resourceAwsRDSGlobalCluster(), + "aws_redshift_cluster": resourceAwsRedshiftCluster(), + "aws_redshift_security_group": resourceAwsRedshiftSecurityGroup(), + "aws_redshift_parameter_group": resourceAwsRedshiftParameterGroup(), + "aws_redshift_subnet_group": resourceAwsRedshiftSubnetGroup(), + "aws_redshift_snapshot_copy_grant": resourceAwsRedshiftSnapshotCopyGrant(), + "aws_redshift_snapshot_schedule": resourceAwsRedshiftSnapshotSchedule(), + "aws_redshift_snapshot_schedule_association": resourceAwsRedshiftSnapshotScheduleAssociation(), + "aws_redshift_event_subscription": resourceAwsRedshiftEventSubscription(), + "aws_resourcegroups_group": resourceAwsResourceGroupsGroup(), + "aws_route53_delegation_set": resourceAwsRoute53DelegationSet(), + "aws_route53_query_log": resourceAwsRoute53QueryLog(), + "aws_route53_record": resourceAwsRoute53Record(), + "aws_route53_zone_association": resourceAwsRoute53ZoneAssociation(), + "aws_route53_vpc_association_authorization": resourceAwsRoute53VPCAssociationAuthorization(), + "aws_route53_zone": resourceAwsRoute53Zone(), + "aws_route53_health_check": resourceAwsRoute53HealthCheck(), + "aws_route53_resolver_endpoint": resourceAwsRoute53ResolverEndpoint(), + "aws_route53_resolver_query_log_config": resourceAwsRoute53ResolverQueryLogConfig(), + "aws_route53_resolver_query_log_config_association": resourceAwsRoute53ResolverQueryLogConfigAssociation(), + "aws_route53_resolver_rule_association": resourceAwsRoute53ResolverRuleAssociation(), + "aws_route53_resolver_rule": resourceAwsRoute53ResolverRule(), + "aws_route": resourceAwsRoute(), + "aws_route_table": resourceAwsRouteTable(), + "aws_default_route_table": resourceAwsDefaultRouteTable(), + "aws_route_table_association": resourceAwsRouteTableAssociation(), + "aws_sagemaker_code_repository": resourceAwsSagemakerCodeRepository(), + "aws_sagemaker_model": resourceAwsSagemakerModel(), + "aws_sagemaker_endpoint_configuration": resourceAwsSagemakerEndpointConfiguration(), + "aws_sagemaker_endpoint": resourceAwsSagemakerEndpoint(), + "aws_sagemaker_notebook_instance_lifecycle_configuration": resourceAwsSagemakerNotebookInstanceLifeCycleConfiguration(), + "aws_sagemaker_notebook_instance": resourceAwsSagemakerNotebookInstance(), + "aws_secretsmanager_secret": resourceAwsSecretsManagerSecret(), + "aws_secretsmanager_secret_policy": resourceAwsSecretsManagerSecretPolicy(), + "aws_secretsmanager_secret_version": resourceAwsSecretsManagerSecretVersion(), + "aws_secretsmanager_secret_rotation": resourceAwsSecretsManagerSecretRotation(), + "aws_ses_active_receipt_rule_set": resourceAwsSesActiveReceiptRuleSet(), + "aws_ses_domain_identity": resourceAwsSesDomainIdentity(), + "aws_ses_domain_identity_verification": resourceAwsSesDomainIdentityVerification(), + "aws_ses_domain_dkim": resourceAwsSesDomainDkim(), + "aws_ses_domain_mail_from": resourceAwsSesDomainMailFrom(), + "aws_ses_email_identity": resourceAwsSesEmailIdentity(), + "aws_ses_identity_policy": resourceAwsSesIdentityPolicy(), + "aws_ses_receipt_filter": resourceAwsSesReceiptFilter(), + "aws_ses_receipt_rule": resourceAwsSesReceiptRule(), + "aws_ses_receipt_rule_set": resourceAwsSesReceiptRuleSet(), + "aws_ses_configuration_set": resourceAwsSesConfigurationSet(), + "aws_ses_event_destination": resourceAwsSesEventDestination(), + "aws_ses_identity_notification_topic": resourceAwsSesNotificationTopic(), + "aws_ses_template": resourceAwsSesTemplate(), + "aws_s3_access_point": resourceAwsS3AccessPoint(), + "aws_s3_account_public_access_block": resourceAwsS3AccountPublicAccessBlock(), + "aws_s3_bucket": resourceAwsS3Bucket(), + "aws_s3_bucket_analytics_configuration": resourceAwsS3BucketAnalyticsConfiguration(), + "aws_s3_bucket_policy": resourceAwsS3BucketPolicy(), + "aws_s3_bucket_public_access_block": resourceAwsS3BucketPublicAccessBlock(), + "aws_s3_bucket_object": resourceAwsS3BucketObject(), + "aws_s3_bucket_ownership_controls": resourceAwsS3BucketOwnershipControls(), + "aws_s3_bucket_notification": resourceAwsS3BucketNotification(), + "aws_s3_bucket_metric": resourceAwsS3BucketMetric(), + "aws_s3_bucket_inventory": resourceAwsS3BucketInventory(), + "aws_s3control_bucket": resourceAwsS3ControlBucket(), + "aws_s3control_bucket_policy": resourceAwsS3ControlBucketPolicy(), + "aws_s3control_bucket_lifecycle_configuration": resourceAwsS3ControlBucketLifecycleConfiguration(), + "aws_s3outposts_endpoint": resourceAwsS3OutpostsEndpoint(), + "aws_security_group": resourceAwsSecurityGroup(), + "aws_network_interface_sg_attachment": resourceAwsNetworkInterfaceSGAttachment(), + "aws_default_security_group": resourceAwsDefaultSecurityGroup(), + "aws_security_group_rule": resourceAwsSecurityGroupRule(), + "aws_securityhub_account": resourceAwsSecurityHubAccount(), + "aws_securityhub_action_target": resourceAwsSecurityHubActionTarget(), + "aws_securityhub_member": resourceAwsSecurityHubMember(), + "aws_securityhub_product_subscription": resourceAwsSecurityHubProductSubscription(), + "aws_securityhub_standards_subscription": resourceAwsSecurityHubStandardsSubscription(), + "aws_servicecatalog_portfolio": resourceAwsServiceCatalogPortfolio(), + "aws_service_discovery_http_namespace": resourceAwsServiceDiscoveryHttpNamespace(), + "aws_service_discovery_private_dns_namespace": resourceAwsServiceDiscoveryPrivateDnsNamespace(), + "aws_service_discovery_public_dns_namespace": resourceAwsServiceDiscoveryPublicDnsNamespace(), + "aws_service_discovery_service": resourceAwsServiceDiscoveryService(), + "aws_servicequotas_service_quota": resourceAwsServiceQuotasServiceQuota(), + "aws_shield_protection": resourceAwsShieldProtection(), + "aws_signer_signing_job": resourceAwsSignerSigningJob(), + "aws_signer_signing_profile": resourceAwsSignerSigningProfile(), + "aws_signer_signing_profile_permission": resourceAwsSignerSigningProfilePermission(), + "aws_simpledb_domain": resourceAwsSimpleDBDomain(), + "aws_ssm_activation": resourceAwsSsmActivation(), + "aws_ssm_association": resourceAwsSsmAssociation(), + "aws_ssm_document": resourceAwsSsmDocument(), + "aws_ssm_maintenance_window": resourceAwsSsmMaintenanceWindow(), + "aws_ssm_maintenance_window_target": resourceAwsSsmMaintenanceWindowTarget(), + "aws_ssm_maintenance_window_task": resourceAwsSsmMaintenanceWindowTask(), + "aws_ssm_patch_baseline": resourceAwsSsmPatchBaseline(), + "aws_ssm_patch_group": resourceAwsSsmPatchGroup(), + "aws_ssm_parameter": resourceAwsSsmParameter(), + "aws_ssm_resource_data_sync": resourceAwsSsmResourceDataSync(), + "aws_storagegateway_cache": resourceAwsStorageGatewayCache(), + "aws_storagegateway_cached_iscsi_volume": resourceAwsStorageGatewayCachedIscsiVolume(), + "aws_storagegateway_gateway": resourceAwsStorageGatewayGateway(), + "aws_storagegateway_nfs_file_share": resourceAwsStorageGatewayNfsFileShare(), + "aws_storagegateway_smb_file_share": resourceAwsStorageGatewaySmbFileShare(), + "aws_storagegateway_stored_iscsi_volume": resourceAwsStorageGatewayStoredIscsiVolume(), + "aws_storagegateway_tape_pool": resourceAwsStorageGatewayTapePool(), + "aws_storagegateway_upload_buffer": resourceAwsStorageGatewayUploadBuffer(), + "aws_storagegateway_working_storage": resourceAwsStorageGatewayWorkingStorage(), + "aws_spot_datafeed_subscription": resourceAwsSpotDataFeedSubscription(), + "aws_spot_instance_request": resourceAwsSpotInstanceRequest(), + "aws_spot_fleet_request": resourceAwsSpotFleetRequest(), + "aws_sqs_queue": resourceAwsSqsQueue(), + "aws_sqs_queue_policy": resourceAwsSqsQueuePolicy(), + "aws_snapshot_create_volume_permission": resourceAwsSnapshotCreateVolumePermission(), + "aws_sns_platform_application": resourceAwsSnsPlatformApplication(), + "aws_sns_sms_preferences": resourceAwsSnsSmsPreferences(), + "aws_sns_topic": resourceAwsSnsTopic(), + "aws_sns_topic_policy": resourceAwsSnsTopicPolicy(), + "aws_sns_topic_subscription": resourceAwsSnsTopicSubscription(), + "aws_sfn_activity": resourceAwsSfnActivity(), + "aws_sfn_state_machine": resourceAwsSfnStateMachine(), + "aws_default_subnet": resourceAwsDefaultSubnet(), + "aws_subnet": resourceAwsSubnet(), + "aws_swf_domain": resourceAwsSwfDomain(), + "aws_transfer_server": resourceAwsTransferServer(), + "aws_transfer_ssh_key": resourceAwsTransferSshKey(), + "aws_transfer_user": resourceAwsTransferUser(), + "aws_volume_attachment": resourceAwsVolumeAttachment(), + "aws_vpc_dhcp_options_association": resourceAwsVpcDhcpOptionsAssociation(), + "aws_default_vpc_dhcp_options": resourceAwsDefaultVpcDhcpOptions(), + "aws_vpc_dhcp_options": resourceAwsVpcDhcpOptions(), + "aws_vpc_peering_connection": resourceAwsVpcPeeringConnection(), + "aws_vpc_peering_connection_accepter": resourceAwsVpcPeeringConnectionAccepter(), + "aws_vpc_peering_connection_options": resourceAwsVpcPeeringConnectionOptions(), + "aws_default_vpc": resourceAwsDefaultVpc(), + "aws_vpc": resourceAwsVpc(), + "aws_vpc_endpoint": resourceAwsVpcEndpoint(), + "aws_vpc_endpoint_connection_notification": resourceAwsVpcEndpointConnectionNotification(), + "aws_vpc_endpoint_route_table_association": resourceAwsVpcEndpointRouteTableAssociation(), + "aws_vpc_endpoint_subnet_association": resourceAwsVpcEndpointSubnetAssociation(), + "aws_vpc_endpoint_service": resourceAwsVpcEndpointService(), + "aws_vpc_endpoint_service_allowed_principal": resourceAwsVpcEndpointServiceAllowedPrincipal(), + "aws_vpc_ipv4_cidr_block_association": resourceAwsVpcIpv4CidrBlockAssociation(), + "aws_vpn_connection": resourceAwsVpnConnection(), + "aws_vpn_connection_route": resourceAwsVpnConnectionRoute(), + "aws_vpn_gateway": resourceAwsVpnGateway(), + "aws_vpn_gateway_attachment": resourceAwsVpnGatewayAttachment(), + "aws_vpn_gateway_route_propagation": resourceAwsVpnGatewayRoutePropagation(), + "aws_waf_byte_match_set": resourceAwsWafByteMatchSet(), + "aws_waf_ipset": resourceAwsWafIPSet(), + "aws_waf_rate_based_rule": resourceAwsWafRateBasedRule(), + "aws_waf_regex_match_set": resourceAwsWafRegexMatchSet(), + "aws_waf_regex_pattern_set": resourceAwsWafRegexPatternSet(), + "aws_waf_rule": resourceAwsWafRule(), + "aws_waf_rule_group": resourceAwsWafRuleGroup(), + "aws_waf_size_constraint_set": resourceAwsWafSizeConstraintSet(), + "aws_waf_web_acl": resourceAwsWafWebAcl(), + "aws_waf_xss_match_set": resourceAwsWafXssMatchSet(), + "aws_waf_sql_injection_match_set": resourceAwsWafSqlInjectionMatchSet(), + "aws_waf_geo_match_set": resourceAwsWafGeoMatchSet(), + "aws_wafregional_byte_match_set": resourceAwsWafRegionalByteMatchSet(), + "aws_wafregional_geo_match_set": resourceAwsWafRegionalGeoMatchSet(), + "aws_wafregional_ipset": resourceAwsWafRegionalIPSet(), + "aws_wafregional_rate_based_rule": resourceAwsWafRegionalRateBasedRule(), + "aws_wafregional_regex_match_set": resourceAwsWafRegionalRegexMatchSet(), + "aws_wafregional_regex_pattern_set": resourceAwsWafRegionalRegexPatternSet(), + "aws_wafregional_rule": resourceAwsWafRegionalRule(), + "aws_wafregional_rule_group": resourceAwsWafRegionalRuleGroup(), + "aws_wafregional_size_constraint_set": resourceAwsWafRegionalSizeConstraintSet(), + "aws_wafregional_sql_injection_match_set": resourceAwsWafRegionalSqlInjectionMatchSet(), + "aws_wafregional_xss_match_set": resourceAwsWafRegionalXssMatchSet(), + "aws_wafregional_web_acl": resourceAwsWafRegionalWebAcl(), + "aws_wafregional_web_acl_association": resourceAwsWafRegionalWebAclAssociation(), + "aws_wafv2_ip_set": resourceAwsWafv2IPSet(), + "aws_wafv2_regex_pattern_set": resourceAwsWafv2RegexPatternSet(), + "aws_wafv2_rule_group": resourceAwsWafv2RuleGroup(), + "aws_wafv2_web_acl": resourceAwsWafv2WebACL(), + "aws_wafv2_web_acl_association": resourceAwsWafv2WebACLAssociation(), + "aws_wafv2_web_acl_logging_configuration": resourceAwsWafv2WebACLLoggingConfiguration(), + "aws_worklink_fleet": resourceAwsWorkLinkFleet(), + "aws_worklink_website_certificate_authority_association": resourceAwsWorkLinkWebsiteCertificateAuthorityAssociation(), + "aws_workspaces_directory": resourceAwsWorkspacesDirectory(), + "aws_workspaces_workspace": resourceAwsWorkspacesWorkspace(), + "aws_batch_compute_environment": resourceAwsBatchComputeEnvironment(), + "aws_batch_job_definition": resourceAwsBatchJobDefinition(), + "aws_batch_job_queue": resourceAwsBatchJobQueue(), + "aws_pinpoint_app": resourceAwsPinpointApp(), + "aws_pinpoint_adm_channel": resourceAwsPinpointADMChannel(), + "aws_pinpoint_apns_channel": resourceAwsPinpointAPNSChannel(), + "aws_pinpoint_apns_sandbox_channel": resourceAwsPinpointAPNSSandboxChannel(), + "aws_pinpoint_apns_voip_channel": resourceAwsPinpointAPNSVoipChannel(), + "aws_pinpoint_apns_voip_sandbox_channel": resourceAwsPinpointAPNSVoipSandboxChannel(), + "aws_pinpoint_baidu_channel": resourceAwsPinpointBaiduChannel(), + "aws_pinpoint_email_channel": resourceAwsPinpointEmailChannel(), + "aws_pinpoint_event_stream": resourceAwsPinpointEventStream(), + "aws_pinpoint_gcm_channel": resourceAwsPinpointGCMChannel(), + "aws_pinpoint_sms_channel": resourceAwsPinpointSMSChannel(), + "aws_xray_encryption_config": resourceAwsXrayEncryptionConfig(), + "aws_xray_group": resourceAwsXrayGroup(), + "aws_xray_sampling_rule": resourceAwsXraySamplingRule(), + "aws_workspaces_ip_group": resourceAwsWorkspacesIpGroup(), // ALBs are actually LBs because they can be type `network` or `application` // To avoid regressions, we will add a new resource for each and they both point @@ -1043,6 +1041,11 @@ func Provider() *schema.Provider { }, } + // Avoid Go formatting churn and Git conflicts + // You probably should not do this + provider.DataSourcesMap["aws_serverlessapplicationrepository_application"] = dataSourceAwsServerlessApplicationRepositoryApplication() + provider.ResourcesMap["aws_serverlessapplicationrepository_cloudformation_stack"] = resourceAwsServerlessApplicationRepositoryCloudFormationStack() + provider.ConfigureFunc = func(d *schema.ResourceData) (interface{}, error) { terraformVersion := provider.TerraformVersion if terraformVersion == "" {