Skip to content

Commit

Permalink
test(all): acc. test working against real infrastructure (#68)
Browse files Browse the repository at this point in the history
* test(all): acc. test working against real infrastructure

* test(all): acc. test working against real infrastructure #2

* test(all): acc. test working against real infrastructure #3
  • Loading branch information
ndopj authored Nov 29, 2023
1 parent 8bf57fd commit ac5b666
Show file tree
Hide file tree
Showing 40 changed files with 894 additions and 1,246 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ jobs:
go test -v ./... -coverprofile=coverage.out
env:
TF_ACC: '1'
MC_API_KEY_ID: ${{ secrets.ACC_TEST_MC_API_KEY_ID }}
MC_API_KEY_TOKEN: ${{ secrets.ACC_TEST_MC_API_KEY_TOKEN }}
BQ_SERVICE_ACCOUNT: ${{ secrets.ACC_TEST_BQ_SERVICE_ACCOUNT }}
PG_HOST: ${{ secrets.ACC_TEST_PG_HOST }}
PG_PORT: ${{ secrets.ACC_TEST_PG_PORT }}
PG_DATABASE: ${{ secrets.ACC_TEST_PG_DATABASE }}
PG_USER: ${{ secrets.ACC_TEST_PG_USER }}
PG_PASSWORD: ${{ secrets.ACC_TEST_PG_PASSWORD }}
- uses: actions/upload-artifact@v3
with:
name: coverage
Expand Down
File renamed without changes.
12 changes: 4 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@ go 1.21.1
require (
github.com/hashicorp/terraform-plugin-framework v1.4.2
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
github.com/hashicorp/terraform-plugin-go v0.19.0
github.com/hashicorp/terraform-plugin-go v0.19.1
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-testing v1.5.1
github.com/hasura/go-graphql-client v0.10.0
github.com/stretchr/testify v1.8.4
)

require (
github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/cloudflare/circl v1.3.5 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
Expand All @@ -37,7 +35,7 @@ require (
github.com/hashicorp/terraform-exec v0.19.0 // indirect
github.com/hashicorp/terraform-json v0.17.1 // indirect
github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0 // indirect
github.com/hashicorp/terraform-registry-address v0.2.2 // indirect
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/kr/pretty v0.3.1 // indirect
Expand All @@ -49,10 +47,9 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/objx v0.5.1 // indirect
github.com/stretchr/testify v1.8.2 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v5 v5.4.0 // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/zclconf/go-cty v1.14.1 // indirect
golang.org/x/crypto v0.14.0 // indirect
Expand All @@ -66,6 +63,5 @@ require (
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
nhooyr.io/websocket v1.8.9 // indirect
)
17 changes: 7 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ github.com/hashicorp/terraform-plugin-framework v1.4.2 h1:P7a7VP1GZbjc4rv921Xy5O
github.com/hashicorp/terraform-plugin-framework v1.4.2/go.mod h1:GWl3InPFZi2wVQmdVnINPKys09s9mLmTZr95/ngLnbY=
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0 h1:HOjBuMbOEzl7snOdOoUfE2Jgeto6JOjLVQ39Ls2nksc=
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0/go.mod h1:jfHGE/gzjxYz6XoUwi/aYiiKrJDeutQNUtGQXkaHklg=
github.com/hashicorp/terraform-plugin-go v0.19.0 h1:BuZx/6Cp+lkmiG0cOBk6Zps0Cb2tmqQpDM3iAtnhDQU=
github.com/hashicorp/terraform-plugin-go v0.19.0/go.mod h1:EhRSkEPNoylLQntYsk5KrDHTZJh9HQoumZXbOGOXmec=
github.com/hashicorp/terraform-plugin-go v0.19.1 h1:lf/jTGTeELcz5IIbn/94mJdmnTjRYm6S6ct/JqCSr50=
github.com/hashicorp/terraform-plugin-go v0.19.1/go.mod h1:5NMIS+DXkfacX6o5HCpswda5yjkSYfKzn1Nfl9l+qRs=
github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0=
github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0 h1:wcOKYwPI9IorAJEBLzgclh3xVolO7ZorYd6U1vnok14=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.29.0/go.mod h1:qH/34G25Ugdj5FcM95cSoXzUgIbgfhVLXCcEcYaMwq8=
github.com/hashicorp/terraform-plugin-testing v1.5.1 h1:T4aQh9JAhmWo4+t1A7x+rnxAJHCDIYW9kXyo4sVO92c=
github.com/hashicorp/terraform-plugin-testing v1.5.1/go.mod h1:dg8clO6K59rZ8w9EshBmDp1CxTIPu3yA4iaDpX1h5u0=
github.com/hashicorp/terraform-registry-address v0.2.2 h1:lPQBg403El8PPicg/qONZJDC6YlgCVbWDtNmmZKtBno=
github.com/hashicorp/terraform-registry-address v0.2.2/go.mod h1:LtwNbCihUoUZ3RYriyS2wF/lGPB6gF9ICLRtuDk7hSo=
github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI=
github.com/hashicorp/terraform-registry-address v0.2.3/go.mod h1:lFHA76T8jfQteVfT7caREqguFrW3c4MFSPhZB7HHgUM=
github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ=
github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc=
github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE=
Expand Down Expand Up @@ -157,19 +157,16 @@ github.com/skeema/knownhosts v1.2.0/go.mod h1:g4fPeYpque7P0xefxtGzV81ihjC8sX2Iqp
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.1 h1:4VhoImhV/Bm0ToFkXFi8hXNXwpDRZ/ynw3amt82mzq0=
github.com/stretchr/objx v0.5.1/go.mod h1:/iHQpkQwBD6DLUmQ4pE+s1TXdob1mORJ4/UFdrifcy0=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI=
github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
github.com/vmihailenco/msgpack/v5 v5.4.0 h1:hRM0digJwyR6vll33NNAwCFguy5JuBD6jxDmQP3l608=
github.com/vmihailenco/msgpack/v5 v5.4.0/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok=
github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8=
github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok=
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
Expand Down
27 changes: 27 additions & 0 deletions internal/acctest/acctest.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package acctest

import (
"os"
"testing"

"github.com/kiwicom/terraform-provider-montecarlo/internal"

"github.com/hashicorp/terraform-plugin-framework/providerserver"
"github.com/hashicorp/terraform-plugin-go/tfprotov6"
)

// testAccProtoV6ProviderFactories are used to instantiate a provider during
// acceptance testing. The factory function will be invoked for every Terraform
// CLI command executed to create a provider server to which the CLI can
// reattach.
var TestAccProviderFactories = map[string]func() (tfprotov6.ProviderServer, error){
"montecarlo": providerserver.NewProtocol6WithError(internal.New("test")()),
}

func TestAccPreCheck(t *testing.T) {
if v := os.Getenv("MC_API_KEY_ID"); v == "" {
t.Fatalf("'MC_API_KEY_ID' must be set for acceptance tests")
} else if v := os.Getenv("MC_API_KEY_TOKEN"); v == "" {
t.Fatalf("'MC_API_KEY_TOKEN' must be set for acceptance tests")
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package resources
package authorization

import (
"context"
"fmt"

"github.com/kiwicom/terraform-provider-montecarlo/monte_carlo/client"
"github.com/kiwicom/terraform-provider-montecarlo/monte_carlo/common"
"github.com/kiwicom/terraform-provider-montecarlo/client"
"github.com/kiwicom/terraform-provider-montecarlo/internal/common"

"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
"github.com/hashicorp/terraform-plugin-framework/attr"
Expand Down Expand Up @@ -120,7 +120,7 @@ func (r *IamGroupResource) Create(ctx context.Context, req resource.CreateReques
"label": data.Name.ValueString(),
"description": data.Description.ValueString(),
"roles": []string{data.Role.ValueString()},
"domainRestrictionIds": normalize[client.UUID](data.Domains),
"domainRestrictionIds": common.TfStringsTo[client.UUID](data.Domains),
"ssoGroup": data.SsoGroup.ValueStringPointer(),
}

Expand Down Expand Up @@ -164,8 +164,8 @@ func (r *IamGroupResource) Read(ctx context.Context, req resource.ReadRequest, r
} else {
data.Label = types.StringValue(found.Label)
data.Description = types.StringValue(found.Description)
data.Role = denormalize(rolesToNames(found.Roles))[0]
data.Domains = denormalize(domainsToUuids[string](found.DomainRestrictions))
data.Role = common.TfStringsFrom(rolesToNames(found.Roles))[0]
data.Domains = common.TfStringsFrom(domainsToUuids[string](found.DomainRestrictions))
data.SsoGroup = types.StringPointerValue(found.SsoGroup)
resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
}
Expand All @@ -184,7 +184,7 @@ func (r *IamGroupResource) Update(ctx context.Context, req resource.UpdateReques
"label": data.Name.ValueString(),
"description": data.Description.ValueString(),
"roles": []string{data.Role.ValueString()},
"domainRestrictionIds": normalize[client.UUID](data.Domains),
"domainRestrictionIds": common.TfStringsTo[client.UUID](data.Domains),
"ssoGroup": data.SsoGroup.ValueStringPointer(),
}

Expand Down
71 changes: 71 additions & 0 deletions internal/authorization/iam_group_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package authorization_test

import (
"os"
"testing"

"github.com/kiwicom/terraform-provider-montecarlo/internal/acctest"

"github.com/hashicorp/terraform-plugin-testing/config"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
"github.com/hashicorp/terraform-plugin-testing/terraform"
)

func TestAccIamGroupResource(t *testing.T) {
mc_api_key_id := os.Getenv("MC_API_KEY_ID")
mc_api_key_token := os.Getenv("MC_API_KEY_TOKEN")

resource.Test(t, resource.TestCase{
PreCheck: func() { acctest.TestAccPreCheck(t) },
Steps: []resource.TestStep{
{ // Create and Read testing
ProtoV6ProviderFactories: acctest.TestAccProviderFactories,
ConfigFile: config.TestNameFile("create.tf"),
ConfigVariables: config.Variables{
"montecarlo_api_key_id": config.StringVariable(mc_api_key_id),
"montecarlo_api_key_token": config.StringVariable(mc_api_key_token),
},
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("montecarlo_iam_group.test", "name", "group-1"),
resource.TestCheckResourceAttr("montecarlo_iam_group.test", "label", "group-1"),
resource.TestCheckResourceAttr("montecarlo_iam_group.test", "description", ""),
resource.TestCheckResourceAttr("montecarlo_iam_group.test", "role", "mcd/editor"),
resource.TestCheckResourceAttr("montecarlo_iam_group.test", "domains.#", "0"),
resource.TestCheckNoResourceAttr("montecarlo_iam_group.test", "ssoGroup"),
),
},
{ // ImportState testing
ProtoV6ProviderFactories: acctest.TestAccProviderFactories,
ConfigVariables: config.Variables{
"montecarlo_api_key_id": config.StringVariable(mc_api_key_id),
"montecarlo_api_key_token": config.StringVariable(mc_api_key_token),
},
ResourceName: "montecarlo_iam_group.test",
ImportState: true,
ImportStateVerify: true,
ImportStateIdFunc: func(s *terraform.State) (string, error) {
return s.RootModule().Resources["montecarlo_iam_group.test"].Primary.Attributes["name"], nil
},
ImportStateVerifyIdentifierAttribute: "name",
},
{ // Update and Read testing
ProtoV6ProviderFactories: acctest.TestAccProviderFactories,
ConfigFile: config.TestNameFile("update.tf"),
ConfigVariables: config.Variables{
"montecarlo_api_key_id": config.StringVariable(mc_api_key_id),
"montecarlo_api_key_token": config.StringVariable(mc_api_key_token),
},
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("montecarlo_iam_group.test", "name", "group-1"),
resource.TestCheckResourceAttr("montecarlo_iam_group.test", "label", "group-1"),
resource.TestCheckResourceAttr("montecarlo_iam_group.test", "description", ""),
resource.TestCheckResourceAttr("montecarlo_iam_group.test", "role", "mcd/viewer"),
resource.TestCheckResourceAttr("montecarlo_iam_group.test", "domains.#", "2"),
resource.TestCheckTypeSetElemAttr("montecarlo_iam_group.test", "domains.*", "ba0c4080-089d-4377-8878-466c31d19807"),
resource.TestCheckTypeSetElemAttr("montecarlo_iam_group.test", "domains.*", "dd4cda19-1c5c-4339-9628-76376c9e281e"),
resource.TestCheckResourceAttr("montecarlo_iam_group.test", "sso_group", "ssoGroup1"),
),
},
},
})
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package resources
package authorization

import (
"context"
Expand All @@ -7,8 +7,8 @@ import (
"slices"
"strings"

"github.com/kiwicom/terraform-provider-montecarlo/monte_carlo/client"
"github.com/kiwicom/terraform-provider-montecarlo/monte_carlo/common"
"github.com/kiwicom/terraform-provider-montecarlo/client"
"github.com/kiwicom/terraform-provider-montecarlo/internal/common"

"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
"github.com/hashicorp/terraform-plugin-framework/path"
Expand Down Expand Up @@ -122,7 +122,7 @@ func (r *IamMemberResource) Create(ctx context.Context, req resource.CreateReque
var group *client.AuthorizationGroup
groupName := strings.Split(data.Group.ValueString(), "groups/")[1]
if index := slices.IndexFunc(getGroupResult.GetAuthorizationGroups, func(group client.AuthorizationGroup) bool {
return group.SsoGroup == nil && group.Name == groupName
return (group.SsoGroup == nil || *group.SsoGroup == "") && group.Name == groupName
}); index >= 0 {
group = &getGroupResult.GetAuthorizationGroups[index]
} else {
Expand Down Expand Up @@ -187,7 +187,7 @@ func (r *IamMemberResource) Read(ctx context.Context, req resource.ReadRequest,
var group *client.AuthorizationGroup
groupName := strings.Split(data.Group.ValueString(), "groups/")[1]
if index := slices.IndexFunc(getGroupResult.GetAuthorizationGroups, func(group client.AuthorizationGroup) bool {
return group.SsoGroup == nil && group.Name == groupName
return (group.SsoGroup == nil || *group.SsoGroup == "") && group.Name == groupName
}); index >= 0 {
group = &getGroupResult.GetAuthorizationGroups[index]
} else {
Expand Down
60 changes: 60 additions & 0 deletions internal/authorization/iam_member_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package authorization_test

import (
"os"
"testing"

"github.com/kiwicom/terraform-provider-montecarlo/internal/acctest"

"github.com/hashicorp/terraform-plugin-testing/config"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)

func TestAccIamMemberResource(t *testing.T) {
mc_api_key_id := os.Getenv("MC_API_KEY_ID")
mc_api_key_token := os.Getenv("MC_API_KEY_TOKEN")

resource.Test(t, resource.TestCase{
PreCheck: func() { acctest.TestAccPreCheck(t) },
Steps: []resource.TestStep{
{ // Create and Read testing
ProtoV6ProviderFactories: acctest.TestAccProviderFactories,
ConfigFile: config.TestNameFile("create.tf"),
ConfigVariables: config.Variables{
"montecarlo_api_key_id": config.StringVariable(mc_api_key_id),
"montecarlo_api_key_token": config.StringVariable(mc_api_key_token),
},
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("montecarlo_iam_member.test", "group", "groups/TestAccIamMemberResource"),
resource.TestCheckResourceAttr("montecarlo_iam_member.test", "member", "user:[email protected]"),
resource.TestCheckResourceAttr("montecarlo_iam_member.test", "member_id", "21ddb883-7586-4034-9767-e5f966ec10df"),
),
},
{ // ImportState testing
ProtoV6ProviderFactories: acctest.TestAccProviderFactories,
ConfigVariables: config.Variables{
"montecarlo_api_key_id": config.StringVariable(mc_api_key_id),
"montecarlo_api_key_token": config.StringVariable(mc_api_key_token),
},
ResourceName: "montecarlo_iam_member.test",
ImportState: true,
ImportStateVerify: true,
ImportStateId: "groups/TestAccIamMemberResource,user:[email protected]",
ImportStateVerifyIdentifierAttribute: "group",
},
{ // Update and Read testing
ProtoV6ProviderFactories: acctest.TestAccProviderFactories,
ConfigFile: config.TestNameFile("update_group.tf"),
ConfigVariables: config.Variables{
"montecarlo_api_key_id": config.StringVariable(mc_api_key_id),
"montecarlo_api_key_token": config.StringVariable(mc_api_key_token),
},
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("montecarlo_iam_member.test", "group", "groups/TestAccIamMemberResource2"),
resource.TestCheckResourceAttr("montecarlo_iam_member.test", "member", "user:[email protected]"),
resource.TestCheckResourceAttr("montecarlo_iam_member.test", "member_id", "21ddb883-7586-4034-9767-e5f966ec10df"),
),
},
},
})
}
19 changes: 19 additions & 0 deletions internal/authorization/testdata/TestAccIamGroupResource/create.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
variable "montecarlo_api_key_id" {
type = string
}

variable "montecarlo_api_key_token" {
type = string
}

provider "montecarlo" {
account_service_key = {
id = var.montecarlo_api_key_id # (secret)
token = var.montecarlo_api_key_token # (secret)
}
}

resource "montecarlo_iam_group" "test" {
name = "group-1"
role = "mcd/editor"
}
24 changes: 24 additions & 0 deletions internal/authorization/testdata/TestAccIamGroupResource/update.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
variable "montecarlo_api_key_id" {
type = string
}

variable "montecarlo_api_key_token" {
type = string
}

provider "montecarlo" {
account_service_key = {
id = var.montecarlo_api_key_id # (secret)
token = var.montecarlo_api_key_token # (secret)
}
}

resource "montecarlo_iam_group" "test" {
name = "group-1"
role = "mcd/viewer"
sso_group = "ssoGroup1"
domains = [
"ba0c4080-089d-4377-8878-466c31d19807",
"dd4cda19-1c5c-4339-9628-76376c9e281e"
]
}
Loading

0 comments on commit ac5b666

Please sign in to comment.