diff --git a/aws/data_source_aws_codeartifact_repository_endpoint_test.go b/aws/data_source_aws_codeartifact_repository_endpoint_test.go index 72b56c21b60..17f3a1bd904 100644 --- a/aws/data_source_aws_codeartifact_repository_endpoint_test.go +++ b/aws/data_source_aws_codeartifact_repository_endpoint_test.go @@ -18,7 +18,28 @@ func TestAccAWSCodeArtifactRepositoryEndpointDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckAWSCodeArtifactRepositoryEndpointBasicConfig(rName), + Config: testAccCheckAWSCodeArtifactRepositoryEndpointBasicConfig(rName, "npm"), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(dataSourceName, "repository_endpoint"), + testAccCheckResourceAttrAccountID(dataSourceName, "domain_owner"), + ), + }, + { + Config: testAccCheckAWSCodeArtifactRepositoryEndpointBasicConfig(rName, "pypi"), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(dataSourceName, "repository_endpoint"), + testAccCheckResourceAttrAccountID(dataSourceName, "domain_owner"), + ), + }, + { + Config: testAccCheckAWSCodeArtifactRepositoryEndpointBasicConfig(rName, "maven"), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(dataSourceName, "repository_endpoint"), + testAccCheckResourceAttrAccountID(dataSourceName, "domain_owner"), + ), + }, + { + Config: testAccCheckAWSCodeArtifactRepositoryEndpointBasicConfig(rName, "nuget"), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet(dataSourceName, "repository_endpoint"), testAccCheckResourceAttrAccountID(dataSourceName, "domain_owner"), @@ -66,19 +87,21 @@ resource "aws_codeartifact_repository" "test" { `, rName) } -func testAccCheckAWSCodeArtifactRepositoryEndpointBasicConfig(rName string) string { - return testAccCheckAWSCodeArtifactRepositoryEndpointBaseConfig(rName) + +func testAccCheckAWSCodeArtifactRepositoryEndpointBasicConfig(rName, format string) string { + return composeConfig( + testAccCheckAWSCodeArtifactRepositoryEndpointBaseConfig(rName), fmt.Sprintf(` data "aws_codeartifact_repository_endpoint" "test" { domain = aws_codeartifact_domain.test.domain repository = aws_codeartifact_repository.test.repository - format = "npm" + format = %[1]q } -`) +`, format)) } func testAccCheckAWSCodeArtifactRepositoryEndpointOwnerConfig(rName string) string { - return testAccCheckAWSCodeArtifactRepositoryEndpointBaseConfig(rName) + + return composeConfig( + testAccCheckAWSCodeArtifactRepositoryEndpointBaseConfig(rName), fmt.Sprintf(` data "aws_codeartifact_repository_endpoint" "test" { domain = aws_codeartifact_domain.test.domain @@ -86,5 +109,5 @@ data "aws_codeartifact_repository_endpoint" "test" { domain_owner = aws_codeartifact_domain.test.owner format = "npm" } -`) +`)) } diff --git a/website/docs/d/codeartifact_repository_endpoint.html.markdown b/website/docs/d/codeartifact_repository_endpoint.html.markdown index 6a1e47c94f3..19f90135004 100644 --- a/website/docs/d/codeartifact_repository_endpoint.html.markdown +++ b/website/docs/d/codeartifact_repository_endpoint.html.markdown @@ -26,11 +26,11 @@ The following arguments are supported: * `domain` - (Required) The name of the domain that contains the repository. * `repository` - (Required) The name of the repository. -* `format` - (Required) Which endpoint of a repository to return. A repository has one endpoint for each package format: `npm`, `pypi`, and `maven`. +* `format` - (Required) Which endpoint of a repository to return. A repository has one endpoint for each package format: `npm`, `pypi`, `maven`, and `nuget`. * `domain_owner` - (Optional) The account number of the AWS account that owns the domain. ## Attributes Reference In addition to the argument above, the following attributes are exported: -* `repository_endpoint` - The URL of the returned endpoint. \ No newline at end of file +* `repository_endpoint` - The URL of the returned endpoint.