mirror of https://github.com/hashicorp/terraform
Changes required: * ECR Read func doesn't need to take ``registry_id` as it uses the current account Id * `name` wasn't being set in the ECR Read so the import was failing as name wasn't found ``` make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSEcrRepository_' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /vendor/) TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSEcrRepository_ -timeout 120m === RUN TestAccAWSEcrRepository_importBasic --- PASS: TestAccAWSEcrRepository_importBasic (17.37s) === RUN TestAccAWSEcrRepository_basic --- PASS: TestAccAWSEcrRepository_basic (16.05s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 33.437s ```pull/7281/head
parent
004cec60b3
commit
edf593febd
@ -0,0 +1,28 @@
|
||||
package aws
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
)
|
||||
|
||||
func TestAccAWSEcrRepository_importBasic(t *testing.T) {
|
||||
resourceName := "aws_ecr_repository.default"
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckAWSEcrRepositoryDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: testAccAWSEcrRepository,
|
||||
},
|
||||
|
||||
resource.TestStep{
|
||||
ResourceName: resourceName,
|
||||
ImportState: true,
|
||||
ImportStateVerify: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
Loading…
Reference in new issue