Skip to content

Commit

Permalink
feat: Migrate Resource: mongodbatlas_project_ip_access_list to Terraf…
Browse files Browse the repository at this point in the history
…orm Plugin Framework (#1411)
  • Loading branch information
andreaangiolillo authored Aug 28, 2023
1 parent 69f95a0 commit 76b1758
Show file tree
Hide file tree
Showing 10 changed files with 554 additions and 339 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- 'mongodbatlas/data_source_mongodbatlas_projects.go'
- 'mongodbatlas/resource_mongodbatlas_access_list_api_key*.go'
- 'mongodbatlas/resource_mongodbatlas_project_invitation*.go'
- 'mongodbatlas/resource_mongodbatlas_project_ip_access_list*.go'
- 'mongodbatlas/fw_resource_mongodbatlas_project_ip_access_list*.go'
- 'mongodbatlas/resource_mongodbatlas_project.go'
- 'mongodbatlas/resource_mongodbatlas_project_test.go'
serverless:
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ require (
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.18.1 // indirect
github.com/hashicorp/terraform-json v0.17.1 // indirect
github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1
github.com/hashicorp/terraform-registry-address v0.2.1 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,8 @@ github.com/hashicorp/terraform-json v0.17.1 h1:eMfvh/uWggKmY7Pmb3T85u86E2EQg6EQH
github.com/hashicorp/terraform-json v0.17.1/go.mod h1:Huy6zt6euxaY9knPAFKjUITn8QxUFIe9VuSzb4zn/0o=
github.com/hashicorp/terraform-plugin-framework v1.3.4 h1:dOTLsALgmQu+PawAvhfGQ04H0MeIz3EZmBw7OFvj7qs=
github.com/hashicorp/terraform-plugin-framework v1.3.4/go.mod h1:2gGDpWiTI0irr9NSTLFAKlTi6KwGti3AoU19rFqU30o=
github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1 h1:gm5b1kHgFFhaKFhm4h2TgvMUlNzFAtUqlcOWnWPm+9E=
github.com/hashicorp/terraform-plugin-framework-timeouts v0.4.1/go.mod h1:MsjL1sQ9L7wGwzJ5RjcI6FzEMdyoBnw+XK8ZnOvQOLY=
github.com/hashicorp/terraform-plugin-framework-validators v0.10.0 h1:4L0tmy/8esP6OcvocVymw52lY0HyQ5OxB7VNl7k4bS0=
github.com/hashicorp/terraform-plugin-framework-validators v0.10.0/go.mod h1:qdQJCdimB9JeX2YwOpItEu+IrfoJjWQ5PhLpAOMDQAE=
github.com/hashicorp/terraform-plugin-go v0.18.0 h1:IwTkOS9cOW1ehLd/rG0y+u/TGLK9y6fGoBjXVUquzpE=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ func newTFProjectIPAccessListDSModel(ctx context.Context, accessList *matlas.Pro
entry = accessList.AwsSecurityGroup
}

id := fmt.Sprintf("%s-%s", accessList.GroupID, entry)
id := encodeStateID(map[string]string{
"entry": entry,
"project_id": accessList.GroupID,
})

databaseUserModel.ID = types.StringValue(id)
return databaseUserModel, nil
}
1 change: 1 addition & 0 deletions mongodbatlas/fw_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ func (p *MongodbtlasProvider) Resources(context.Context) []func() resource.Resou
NewEncryptionAtRestRS,
NewDatabaseUserRS,
NewAlertConfigurationRS,
NewProjectIPAccessListRS,
}
}

Expand Down
Loading

0 comments on commit 76b1758

Please sign in to comment.