mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-03 08:42:39 +00:00
Excise unnecessary type declarations.
Some struct types can be inferred instead of being repeated, so let's take advantage of that.
This commit is contained in:
parent
fa2d54f408
commit
199ff5d1f1
|
@ -16,24 +16,24 @@ func resourceGoogleProjectIamBinding() *schema.Resource {
|
|||
Delete: resourceGoogleProjectIamBindingDelete,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"project": &schema.Schema{
|
||||
"project": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"role": &schema.Schema{
|
||||
"role": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"members": &schema.Schema{
|
||||
"members": {
|
||||
Type: schema.TypeSet,
|
||||
Required: true,
|
||||
Elem: &schema.Schema{
|
||||
Elem: {
|
||||
Type: schema.TypeString,
|
||||
},
|
||||
},
|
||||
"etag": &schema.Schema{
|
||||
"etag": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
|
|
@ -19,14 +19,14 @@ func TestAccGoogleProjectIamBinding_basic(t *testing.T) {
|
|||
Providers: testAccProviders,
|
||||
Steps: []resource.TestStep{
|
||||
// Create a new project
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccGoogleProject_create(pid, pname, org),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccGoogleProjectExistingPolicy(pid),
|
||||
),
|
||||
},
|
||||
// Apply an IAM binding
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccGoogleProjectAssociateBindingBasic(pid, pname, org),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckGoogleProjectIamBindingExists("google_project_iam_binding.acceptance", &cloudresourcemanager.Binding{
|
||||
|
@ -47,14 +47,14 @@ func TestAccGoogleProjectIamBinding_multiple(t *testing.T) {
|
|||
Providers: testAccProviders,
|
||||
Steps: []resource.TestStep{
|
||||
// Create a new project
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccGoogleProject_create(pid, pname, org),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccGoogleProjectExistingPolicy(pid),
|
||||
),
|
||||
},
|
||||
// Apply an IAM binding
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccGoogleProjectAssociateBindingBasic(pid, pname, org),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckGoogleProjectIamBindingExists("google_project_iam_binding.acceptance", &cloudresourcemanager.Binding{
|
||||
|
@ -64,7 +64,7 @@ func TestAccGoogleProjectIamBinding_multiple(t *testing.T) {
|
|||
),
|
||||
},
|
||||
// Apply another IAM binding
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccGoogleProjectAssociateBindingMultiple(pid, pname, org),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckGoogleProjectIamBindingExists("google_project_iam_binding.multiple", &cloudresourcemanager.Binding{
|
||||
|
@ -85,14 +85,14 @@ func TestAccGoogleProjectIamBinding_update(t *testing.T) {
|
|||
Providers: testAccProviders,
|
||||
Steps: []resource.TestStep{
|
||||
// Create a new project
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccGoogleProject_create(pid, pname, org),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccGoogleProjectExistingPolicy(pid),
|
||||
),
|
||||
},
|
||||
// Apply an IAM binding
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccGoogleProjectAssociateBindingBasic(pid, pname, org),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckGoogleProjectIamBindingExists("google_project_iam_binding.acceptance", &cloudresourcemanager.Binding{
|
||||
|
@ -102,7 +102,7 @@ func TestAccGoogleProjectIamBinding_update(t *testing.T) {
|
|||
),
|
||||
},
|
||||
// Apply an updated IAM binding
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccGoogleProjectAssociateBindingUpdated(pid, pname, org),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckGoogleProjectIamBindingExists("google_project_iam_binding.updated", &cloudresourcemanager.Binding{
|
||||
|
@ -123,14 +123,14 @@ func TestAccGoogleProjectIamBinding_remove(t *testing.T) {
|
|||
Providers: testAccProviders,
|
||||
Steps: []resource.TestStep{
|
||||
// Create a new project
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccGoogleProject_create(pid, pname, org),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccGoogleProjectExistingPolicy(pid),
|
||||
),
|
||||
},
|
||||
// Apply multiple IAM bindings
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccGoogleProjectAssociateBindingMultiple(pid, pname, org),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckGoogleProjectIamBindingExists("google_project_iam_binding.multiple", &cloudresourcemanager.Binding{
|
||||
|
@ -144,7 +144,7 @@ func TestAccGoogleProjectIamBinding_remove(t *testing.T) {
|
|||
),
|
||||
},
|
||||
// Remove the bindings
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccGoogleProject_create(pid, pname, org),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccGoogleProjectExistingPolicy(pid),
|
||||
|
|
|
@ -15,22 +15,22 @@ func resourceGoogleProjectIamMember() *schema.Resource {
|
|||
Delete: resourceGoogleProjectIamMemberDelete,
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"project": &schema.Schema{
|
||||
"project": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"role": &schema.Schema{
|
||||
"role": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"member": &schema.Schema{
|
||||
"member": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"etag": &schema.Schema{
|
||||
"etag": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
|
|
@ -17,14 +17,14 @@ func TestAccGoogleProjectIamMember_basic(t *testing.T) {
|
|||
Providers: testAccProviders,
|
||||
Steps: []resource.TestStep{
|
||||
// Create a new project
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccGoogleProject_create(pid, pname, org),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccGoogleProjectExistingPolicy(pid),
|
||||
),
|
||||
},
|
||||
// Apply an IAM binding
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccGoogleProjectAssociateMemberBasic(pid, pname, org),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckGoogleProjectIamBindingExists("google_project_iam_member.acceptance", &cloudresourcemanager.Binding{
|
||||
|
@ -45,14 +45,14 @@ func TestAccGoogleProjectIamMember_multiple(t *testing.T) {
|
|||
Providers: testAccProviders,
|
||||
Steps: []resource.TestStep{
|
||||
// Create a new project
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccGoogleProject_create(pid, pname, org),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccGoogleProjectExistingPolicy(pid),
|
||||
),
|
||||
},
|
||||
// Apply an IAM binding
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccGoogleProjectAssociateMemberBasic(pid, pname, org),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckGoogleProjectIamBindingExists("google_project_iam_member.acceptance", &cloudresourcemanager.Binding{
|
||||
|
@ -62,7 +62,7 @@ func TestAccGoogleProjectIamMember_multiple(t *testing.T) {
|
|||
),
|
||||
},
|
||||
// Apply another IAM binding
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccGoogleProjectAssociateMemberMultiple(pid, pname, org),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckGoogleProjectIamBindingExists("google_project_iam_member.multiple", &cloudresourcemanager.Binding{
|
||||
|
@ -83,14 +83,14 @@ func TestAccGoogleProjectIamMember_remove(t *testing.T) {
|
|||
Providers: testAccProviders,
|
||||
Steps: []resource.TestStep{
|
||||
// Create a new project
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccGoogleProject_create(pid, pname, org),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccGoogleProjectExistingPolicy(pid),
|
||||
),
|
||||
},
|
||||
// Apply multiple IAM bindings
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccGoogleProjectAssociateMemberMultiple(pid, pname, org),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckGoogleProjectIamBindingExists("google_project_iam_member.acceptance", &cloudresourcemanager.Binding{
|
||||
|
@ -100,7 +100,7 @@ func TestAccGoogleProjectIamMember_remove(t *testing.T) {
|
|||
),
|
||||
},
|
||||
// Remove the bindings
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testAccGoogleProject_create(pid, pname, org),
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccGoogleProjectExistingPolicy(pid),
|
||||
|
|
Loading…
Reference in New Issue
Block a user