From 9d6c61d102a755a8c7cea5576400fedb571135ac Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 28 May 2021 12:23:28 -0400 Subject: [PATCH 01/11] i/ds/servicecat_launch_paths: Add statuser --- .../service/servicecatalog/waiter/status.go | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/aws/internal/service/servicecatalog/waiter/status.go b/aws/internal/service/servicecatalog/waiter/status.go index 338e821b70b..32372929bbb 100644 --- a/aws/internal/service/servicecatalog/waiter/status.go +++ b/aws/internal/service/servicecatalog/waiter/status.go @@ -319,3 +319,40 @@ func PrincipalPortfolioAssociationStatus(conn *servicecatalog.ServiceCatalog, ac return output, servicecatalog.StatusAvailable, err } } + +func LaunchPathsStatus(conn *servicecatalog.ServiceCatalog, acceptLanguage, productID string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + input := &servicecatalog.ListLaunchPathsInput{ + AcceptLanguage: aws.String(acceptLanguage), + ProductId: aws.String(productID), + } + + var summaries []*servicecatalog.LaunchPathSummary + + err := conn.ListLaunchPathsPages(input, func(page *servicecatalog.ListLaunchPathsOutput, lastPage bool) bool { + if page == nil { + return !lastPage + } + + for _, summary := range page.LaunchPathSummaries { + if summary == nil { + continue + } + + summaries = append(summaries, summary) + } + + return !lastPage + }) + + if tfawserr.ErrCodeEquals(err, servicecatalog.ErrCodeResourceNotFoundException) { + return nil, StatusNotFound, err + } + + if err != nil { + return nil, servicecatalog.StatusFailed, err + } + + return summaries, servicecatalog.StatusAvailable, err + } +} From 9db9162ee8733d5f04464bfbd5b74baa0c161674 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 28 May 2021 12:23:46 -0400 Subject: [PATCH 02/11] i/ds/servicecat_launch_paths: Add waiter --- .../service/servicecatalog/waiter/waiter.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/aws/internal/service/servicecatalog/waiter/waiter.go b/aws/internal/service/servicecatalog/waiter/waiter.go index b388ff87ff6..18162d265f9 100644 --- a/aws/internal/service/servicecatalog/waiter/waiter.go +++ b/aws/internal/service/servicecatalog/waiter/waiter.go @@ -41,6 +41,8 @@ const ( PrincipalPortfolioAssociationReadyTimeout = 3 * time.Minute PrincipalPortfolioAssociationDeleteTimeout = 3 * time.Minute + LaunchPathsReadyTimeout = 3 * time.Minute + StatusNotFound = "NOT_FOUND" StatusUnavailable = "UNAVAILABLE" @@ -443,3 +445,20 @@ func PrincipalPortfolioAssociationDeleted(conn *servicecatalog.ServiceCatalog, a return err } + +func LaunchPathsReady(conn *servicecatalog.ServiceCatalog, acceptLanguage, productID string) ([]*servicecatalog.LaunchPathSummary, error) { + stateConf := &resource.StateChangeConf{ + Pending: []string{StatusNotFound}, + Target: []string{servicecatalog.StatusAvailable}, + Refresh: LaunchPathsStatus(conn, acceptLanguage, productID), + Timeout: LaunchPathsReadyTimeout, + } + + outputRaw, err := stateConf.WaitForState() + + if output, ok := outputRaw.([]*servicecatalog.LaunchPathSummary); ok { + return output, err + } + + return nil, err +} From 07c9eccea098c3aaaeee268435aa7114f8f055f1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 28 May 2021 12:24:07 -0400 Subject: [PATCH 03/11] ds/servicecat_launch_paths: Add new data source --- aws/provider.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/provider.go b/aws/provider.go index e4a20b39bb8..2beeae83cbb 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -391,6 +391,7 @@ func Provider() *schema.Provider { "aws_secretsmanager_secret_rotation": dataSourceAwsSecretsManagerSecretRotation(), "aws_secretsmanager_secret_version": dataSourceAwsSecretsManagerSecretVersion(), "aws_servicecatalog_constraint": dataSourceAwsServiceCatalogConstraint(), + "aws_servicecatalog_launch_paths": dataSourceAwsServiceCatalogLaunchPaths(), "aws_servicecatalog_portfolio": dataSourceAwsServiceCatalogPortfolio(), "aws_servicecatalog_product": dataSourceAwsServiceCatalogProduct(), "aws_servicequotas_service": dataSourceAwsServiceQuotasService(), From 3347feb0594f31904080184f264d1a5693d26086 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 28 May 2021 12:24:34 -0400 Subject: [PATCH 04/11] ds/servicecat_launch_paths: Add new data source --- ..._source_aws_servicecatalog_launch_paths.go | 164 ++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 aws/data_source_aws_servicecatalog_launch_paths.go diff --git a/aws/data_source_aws_servicecatalog_launch_paths.go b/aws/data_source_aws_servicecatalog_launch_paths.go new file mode 100644 index 00000000000..c9482923d9c --- /dev/null +++ b/aws/data_source_aws_servicecatalog_launch_paths.go @@ -0,0 +1,164 @@ +package aws + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/servicecatalog" + "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" + tfservicecatalog "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/servicecatalog" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/servicecatalog/waiter" +) + +func dataSourceAwsServiceCatalogLaunchPaths() *schema.Resource { + return &schema.Resource{ + Read: dataSourceAwsServiceCatalogLaunchPathsRead, + + Schema: map[string]*schema.Schema{ + "accept_language": { + Type: schema.TypeString, + Optional: true, + Default: "en", + ValidateFunc: validation.StringInSlice(tfservicecatalog.AcceptLanguage_Values(), false), + }, + "product_id": { + Type: schema.TypeString, + Required: true, + }, + "summaries": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "constraint_summaries": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "description": { + Type: schema.TypeString, + Computed: true, + }, + "type": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "path_id": { + Type: schema.TypeString, + Computed: true, + }, + "name": { + Type: schema.TypeString, + Computed: true, + }, + "tags": tagsSchemaComputed(), + }, + }, + }, + }, + } +} + +func dataSourceAwsServiceCatalogLaunchPathsRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).scconn + ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig + + summaries, err := waiter.LaunchPathsReady(conn, d.Get("accept_language").(string), d.Get("product_id").(string)) + + if err != nil { + return fmt.Errorf("error describing Service Catalog Launch Paths: %w", err) + } + + if err := d.Set("summaries", flattenServiceCatalogLaunchPathSummaries(summaries, ignoreTagsConfig)); err != nil { + return fmt.Errorf("error setting summaries: %w", err) + } + + d.SetId(d.Get("product_id").(string)) + + return nil +} + +func flattenServiceCatalogLaunchPathSummary(apiObject *servicecatalog.LaunchPathSummary, ignoreTagsConfig *keyvaluetags.IgnoreConfig) map[string]interface{} { + if apiObject == nil { + return nil + } + + tfMap := map[string]interface{}{} + + if len(apiObject.ConstraintSummaries) > 0 { + tfMap["constraint_summaries"] = flattenServiceCatalogConstraintSummaries(apiObject.ConstraintSummaries) + } + + if apiObject.Id != nil { + tfMap["path_id"] = aws.StringValue(apiObject.Id) + } + + if apiObject.Name != nil { + tfMap["name"] = aws.StringValue(apiObject.Name) + } + + tags := keyvaluetags.ServicecatalogKeyValueTags(apiObject.Tags) + + tfMap["tags"] = tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map() + + return tfMap +} + +func flattenServiceCatalogLaunchPathSummaries(apiObjects []*servicecatalog.LaunchPathSummary, ignoreTagsConfig *keyvaluetags.IgnoreConfig) []interface{} { + if len(apiObjects) == 0 { + return nil + } + + var tfList []interface{} + + for _, apiObject := range apiObjects { + if apiObject == nil { + continue + } + + tfList = append(tfList, flattenServiceCatalogLaunchPathSummary(apiObject, ignoreTagsConfig)) + } + + return tfList +} + +func flattenServiceCatalogConstraintSummary(apiObject *servicecatalog.ConstraintSummary) map[string]interface{} { + if apiObject == nil { + return nil + } + + tfMap := map[string]interface{}{} + + if apiObject.Description != nil { + tfMap["description"] = aws.StringValue(apiObject.Description) + } + + if apiObject.Type != nil { + tfMap["type"] = aws.StringValue(apiObject.Type) + } + + return tfMap +} + +func flattenServiceCatalogConstraintSummaries(apiObjects []*servicecatalog.ConstraintSummary) []interface{} { + if len(apiObjects) == 0 { + return nil + } + + var tfList []interface{} + + for _, apiObject := range apiObjects { + if apiObject == nil { + continue + } + + tfList = append(tfList, flattenServiceCatalogConstraintSummary(apiObject)) + } + + return tfList +} From 2879d055ab8c3a6f2e500665bfe395f1e569ae3d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 28 May 2021 12:25:01 -0400 Subject: [PATCH 05/11] tests/ds/servicecat_launch_paths: Add new data source --- ...ce_aws_servicecatalog_launch_paths_test.go | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 aws/data_source_aws_servicecatalog_launch_paths_test.go diff --git a/aws/data_source_aws_servicecatalog_launch_paths_test.go b/aws/data_source_aws_servicecatalog_launch_paths_test.go new file mode 100644 index 00000000000..e78d2bf41b0 --- /dev/null +++ b/aws/data_source_aws_servicecatalog_launch_paths_test.go @@ -0,0 +1,44 @@ +package aws + +import ( + "testing" + + "github.com/aws/aws-sdk-go/service/servicecatalog" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +// THIS IS A HARD CODED TEST TO TEST FUNCTIONALITY WHILE WORKING THROUGH BLOCKED CODE + +// !!FIX THIS!! BEFORE MERGING + +func TestAccAWSServiceCatalogLaunchPathsDataSource_basic(t *testing.T) { + dataSourceName := "data.aws_servicecatalog_launch_paths.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, servicecatalog.EndpointsID), + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccAWSServiceCatalogLaunchPathsDataSourceConfig_basic(rName, rName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(dataSourceName, "accept_language", "en"), + resource.TestCheckResourceAttr(dataSourceName, "product_id", "prod-nui42zvkjm52a"), + resource.TestCheckResourceAttr(dataSourceName, "summaries.#", "1"), + resource.TestCheckResourceAttr(dataSourceName, "summaries.0.path_id", "lpv2-5aftplaxgosvk"), + resource.TestCheckResourceAttr(dataSourceName, "summaries.0.name", "satsuki-11221122"), + ), + }, + }, + }) +} + +func testAccAWSServiceCatalogLaunchPathsDataSourceConfig_basic(rName, description string) string { + return ` +data "aws_servicecatalog_launch_paths" "test" { + product_id = "prod-nui42zvkjm52a" +} +` +} From 40325c11887b2c469fc8525e47c15ba38b06598e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 28 May 2021 12:25:18 -0400 Subject: [PATCH 06/11] docs/ds/servicecat_launch_paths: Add new data source --- .../servicecatalog_launch_paths.html.markdown | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 website/docs/d/servicecatalog_launch_paths.html.markdown diff --git a/website/docs/d/servicecatalog_launch_paths.html.markdown b/website/docs/d/servicecatalog_launch_paths.html.markdown new file mode 100644 index 00000000000..bf69c9b3067 --- /dev/null +++ b/website/docs/d/servicecatalog_launch_paths.html.markdown @@ -0,0 +1,44 @@ +--- +subcategory: "Service Catalog" +layout: "aws" +page_title: "AWS: aws_servicecatalog_constraint" +description: |- + Provides information on a Service Catalog Constraint +--- + +# Data source: aws_servicecatalog_constraint + +Provides information on a Service Catalog Constraint. + +## Example Usage + +### Basic Usage + +```terraform +data "aws_servicecatalog_constraint" "example" { + accept_language = "en" + id = "cons-hrvy0335" +} +``` + +## Argument Reference + +The following arguments are required: + +* `id` - Constraint identifier. + +The following arguments are optional: + +* `accept_language` - (Optional) Language code. Valid values: `en` (English), `jp` (Japanese), `zh` (Chinese). Default value is `en`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `description` - Description of the constraint. +* `owner` - Owner of the constraint. +* `parameters` - Constraint parameters in JSON format. +* `portfolio_id` - Portfolio identifier. +* `product_id` - Product identifier. +* `status` - Constraint status. +* `type` - Type of constraint. Valid values are `LAUNCH`, `NOTIFICATION`, `RESOURCE_UPDATE`, `STACKSET`, and `TEMPLATE`. From ada45b128e309dba41bf50e1e973d99c9cd393f5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 28 May 2021 12:27:18 -0400 Subject: [PATCH 07/11] ds/servicecatalog_launch_paths: Add changelog --- .changelog/19572.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/19572.txt diff --git a/.changelog/19572.txt b/.changelog/19572.txt new file mode 100644 index 00000000000..2c13789f218 --- /dev/null +++ b/.changelog/19572.txt @@ -0,0 +1,3 @@ +```release-notes:new-data-source +aws_servicecatalog_launch_paths +``` \ No newline at end of file From d36c0f1186b4a46eb11a3bf66badf4eb8b85c78f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Tue, 22 Jun 2021 20:18:03 -0400 Subject: [PATCH 08/11] docs/d/servicecat_launch_paths: Fix docs --- .../servicecatalog_launch_paths.html.markdown | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/website/docs/d/servicecatalog_launch_paths.html.markdown b/website/docs/d/servicecatalog_launch_paths.html.markdown index bf69c9b3067..16588cb1b0a 100644 --- a/website/docs/d/servicecatalog_launch_paths.html.markdown +++ b/website/docs/d/servicecatalog_launch_paths.html.markdown @@ -1,23 +1,22 @@ --- subcategory: "Service Catalog" layout: "aws" -page_title: "AWS: aws_servicecatalog_constraint" +page_title: "AWS: aws_servicecatalog_launch_paths" description: |- - Provides information on a Service Catalog Constraint + Provides information on Service Catalog Launch Paths --- -# Data source: aws_servicecatalog_constraint +# Data Source: aws_servicecatalog_launch_paths -Provides information on a Service Catalog Constraint. +Lists the paths to the specified product. A path is how the user has access to a specified product, and is necessary when provisioning a product. A path also determines the constraints put on the product. ## Example Usage ### Basic Usage ```terraform -data "aws_servicecatalog_constraint" "example" { - accept_language = "en" - id = "cons-hrvy0335" +data "aws_servicecatalog_launch_paths" "example" { + product_id = "prod-yakog5pdriver" } ``` @@ -25,7 +24,7 @@ data "aws_servicecatalog_constraint" "example" { The following arguments are required: -* `id` - Constraint identifier. +* `product_id` - Product identifier. The following arguments are optional: @@ -35,10 +34,16 @@ The following arguments are optional: In addition to all arguments above, the following attributes are exported: +* `summaries` - Block with information about the launch path. See details below. + +### summaries + +* `constraint_summaries` - Block for constraints on the portfolio-product relationship. See details below. +* `path_id` - Identifier of the product path. +* `name` - Name of the portfolio to which the path was assigned. +* `tags` - Tags associated with this product path. + +### constraint_summaries + * `description` - Description of the constraint. -* `owner` - Owner of the constraint. -* `parameters` - Constraint parameters in JSON format. -* `portfolio_id` - Portfolio identifier. -* `product_id` - Product identifier. -* `status` - Constraint status. -* `type` - Type of constraint. Valid values are `LAUNCH`, `NOTIFICATION`, `RESOURCE_UPDATE`, `STACKSET`, and `TEMPLATE`. +* `type` - Type of constraint. Valid values are `LAUNCH`, `NOTIFICATION`, `STACKSET`, and `TEMPLATE`. From 42bd098f3491112d78f75616ed4ee55af479e142 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Tue, 22 Jun 2021 20:19:04 -0400 Subject: [PATCH 09/11] docs/d/servicecat_launch_paths: Fix docs --- website/docs/d/servicecatalog_launch_paths.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/d/servicecatalog_launch_paths.html.markdown b/website/docs/d/servicecatalog_launch_paths.html.markdown index 16588cb1b0a..22ebc62d90b 100644 --- a/website/docs/d/servicecatalog_launch_paths.html.markdown +++ b/website/docs/d/servicecatalog_launch_paths.html.markdown @@ -24,7 +24,7 @@ data "aws_servicecatalog_launch_paths" "example" { The following arguments are required: -* `product_id` - Product identifier. +* `product_id` - (Required) Product identifier. The following arguments are optional: From 9189ec75d4d86159cc33630c7ea40706855a9866 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 23 Jun 2021 12:29:58 -0400 Subject: [PATCH 10/11] tests/servicecat_launch_paths: Fix tests --- ...ce_aws_servicecatalog_launch_paths_test.go | 112 ++++++++++++++++-- 1 file changed, 100 insertions(+), 12 deletions(-) diff --git a/aws/data_source_aws_servicecatalog_launch_paths_test.go b/aws/data_source_aws_servicecatalog_launch_paths_test.go index e78d2bf41b0..09ca1e09301 100644 --- a/aws/data_source_aws_servicecatalog_launch_paths_test.go +++ b/aws/data_source_aws_servicecatalog_launch_paths_test.go @@ -1,6 +1,7 @@ package aws import ( + "fmt" "testing" "github.com/aws/aws-sdk-go/service/servicecatalog" @@ -8,12 +9,10 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -// THIS IS A HARD CODED TEST TO TEST FUNCTIONALITY WHILE WORKING THROUGH BLOCKED CODE - -// !!FIX THIS!! BEFORE MERGING - func TestAccAWSServiceCatalogLaunchPathsDataSource_basic(t *testing.T) { dataSourceName := "data.aws_servicecatalog_launch_paths.test" + resourceNameProduct := "aws_servicecatalog_product.test" + resourceNamePortfolio := "aws_servicecatalog_portfolio.test" rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ @@ -22,23 +21,112 @@ func TestAccAWSServiceCatalogLaunchPathsDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccAWSServiceCatalogLaunchPathsDataSourceConfig_basic(rName, rName), + Config: testAccAWSServiceCatalogLaunchPathsDataSourceConfig_basic(rName), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(dataSourceName, "accept_language", "en"), - resource.TestCheckResourceAttr(dataSourceName, "product_id", "prod-nui42zvkjm52a"), + resource.TestCheckResourceAttrPair(dataSourceName, "product_id", resourceNameProduct, "id"), resource.TestCheckResourceAttr(dataSourceName, "summaries.#", "1"), - resource.TestCheckResourceAttr(dataSourceName, "summaries.0.path_id", "lpv2-5aftplaxgosvk"), - resource.TestCheckResourceAttr(dataSourceName, "summaries.0.name", "satsuki-11221122"), + resource.TestCheckResourceAttrPair(dataSourceName, "summaries.0.name", resourceNamePortfolio, "name"), + resource.TestCheckResourceAttrSet(dataSourceName, "summaries.0.path_id"), ), }, }, }) } -func testAccAWSServiceCatalogLaunchPathsDataSourceConfig_basic(rName, description string) string { - return ` +func testAccAWSServiceCatalogLaunchPathsDataSourceConfig_base(rName string) string { + return fmt.Sprintf(` +resource "aws_cloudformation_stack" "test" { + name = %[1]q + + template_body = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = "beskrivning" + distributor = "distributör" + name = %[1]q + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + support_description = "supportbeskrivning" + support_email = "support@example.com" + support_url = "http://example.com" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + name = %[1]q + template_physical_id = aws_cloudformation_stack.test.id + type = "CLOUD_FORMATION_TEMPLATE" + } + + tags = { + Name = %[1]q + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = %[1]q + provider_name = %[1]q +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_partition" "current" {} + +resource "aws_iam_role" "test" { + name = %[1]q + + assume_role_policy = jsonencode({ + Version = "2012-10-17" + Statement = [{ + Action = "sts:AssumeRole" + Effect = "Allow" + Principal = { + Service = "servicecatalog.${data.aws_partition.current.dns_suffix}" + } + Sid = "" + }] + }) +} + +data "aws_caller_identity" "current" {} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_caller_identity.current.arn +} +`, rName) +} + +func testAccAWSServiceCatalogLaunchPathsDataSourceConfig_basic(rName string) string { + return composeConfig(testAccAWSServiceCatalogLaunchPathsDataSourceConfig_base(rName), ` data "aws_servicecatalog_launch_paths" "test" { - product_id = "prod-nui42zvkjm52a" + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + + depends_on = [aws_servicecatalog_principal_portfolio_association.test] } -` +`) } From b3fb2215bdf68c136bdb5ffed11148894e7d2aeb Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 23 Jun 2021 12:30:34 -0400 Subject: [PATCH 11/11] i/servicecat_launch_paths: Fix waiter --- aws/internal/service/servicecatalog/waiter/status.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/internal/service/servicecatalog/waiter/status.go b/aws/internal/service/servicecatalog/waiter/status.go index 32372929bbb..f68a028e0a5 100644 --- a/aws/internal/service/servicecatalog/waiter/status.go +++ b/aws/internal/service/servicecatalog/waiter/status.go @@ -346,7 +346,7 @@ func LaunchPathsStatus(conn *servicecatalog.ServiceCatalog, acceptLanguage, prod }) if tfawserr.ErrCodeEquals(err, servicecatalog.ErrCodeResourceNotFoundException) { - return nil, StatusNotFound, err + return nil, StatusNotFound, nil } if err != nil {