Skip to content

Commit

Permalink
update test fixtures for better imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jbardin committed Jun 20, 2022
1 parent e97ae28 commit c002bab
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
16 changes: 15 additions & 1 deletion internal/terraform/context_import_test.go
Expand Up @@ -52,9 +52,20 @@ func TestContextImport_basic(t *testing.T) {
}
}

// import 1 of count instances in the configuration
func TestContextImport_countIndex(t *testing.T) {
p := testProvider("aws")
m := testModule(t, "import-provider")
m := testModuleInline(t, map[string]string{
"main.tf": `
provider "aws" {
foo = "bar"
}
resource "aws_instance" "foo" {
count = 2
}
`})

ctx := testContext2(t, &ContextOpts{
Providers: map[addrs.Provider]providers.Factory{
addrs.NewDefaultProvider("aws"): testProviderFuncFixed(p),
Expand Down Expand Up @@ -797,6 +808,9 @@ module "b" {
source = "./b"
y = module.a[each.key].y
}
resource "test_resource" "test" {
}
`,
"a/main.tf": `
output "y" {
Expand Down
1 change: 0 additions & 1 deletion internal/terraform/testdata/import-provider/main.tf
Expand Up @@ -3,5 +3,4 @@ provider "aws" {
}

resource "aws_instance" "foo" {
#id = "bar"
}

0 comments on commit c002bab

Please sign in to comment.