1. Packages
  2. Volcengine
  3. API Docs
  4. iam
  5. UserGroupPolicyAttachments
Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine

volcengine.iam.UserGroupPolicyAttachments

Explore with Pulumi AI

Use this data source to query detailed information of iam user group policy attachments

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@pulumi/volcengine";
import * as volcengine from "@volcengine/pulumi";

const fooPolicy = new volcengine.iam.Policy("fooPolicy", {
    policyName: "acc-test-policy",
    description: "acc-test",
    policyDocument: "{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}",
});
const fooUserGroup = new volcengine.iam.UserGroup("fooUserGroup", {
    userGroupName: "acc-test-group",
    description: "acc-test",
    displayName: "acc-test",
});
const fooUserGroupPolicyAttachment = new volcengine.iam.UserGroupPolicyAttachment("fooUserGroupPolicyAttachment", {
    policyName: fooPolicy.policyName,
    policyType: "Custom",
    userGroupName: fooUserGroup.userGroupName,
});
const fooUserGroupPolicyAttachments = volcengine.iam.UserGroupPolicyAttachmentsOutput({
    userGroupName: fooUserGroupPolicyAttachment.userGroupName,
});
Copy
import pulumi
import pulumi_volcengine as volcengine

foo_policy = volcengine.iam.Policy("fooPolicy",
    policy_name="acc-test-policy",
    description="acc-test",
    policy_document="{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}")
foo_user_group = volcengine.iam.UserGroup("fooUserGroup",
    user_group_name="acc-test-group",
    description="acc-test",
    display_name="acc-test")
foo_user_group_policy_attachment = volcengine.iam.UserGroupPolicyAttachment("fooUserGroupPolicyAttachment",
    policy_name=foo_policy.policy_name,
    policy_type="Custom",
    user_group_name=foo_user_group.user_group_name)
foo_user_group_policy_attachments = volcengine.iam.user_group_policy_attachments_output(user_group_name=foo_user_group_policy_attachment.user_group_name)
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/iam"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		fooPolicy, err := iam.NewPolicy(ctx, "fooPolicy", &iam.PolicyArgs{
			PolicyName:     pulumi.String("acc-test-policy"),
			Description:    pulumi.String("acc-test"),
			PolicyDocument: pulumi.String("{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}"),
		})
		if err != nil {
			return err
		}
		fooUserGroup, err := iam.NewUserGroup(ctx, "fooUserGroup", &iam.UserGroupArgs{
			UserGroupName: pulumi.String("acc-test-group"),
			Description:   pulumi.String("acc-test"),
			DisplayName:   pulumi.String("acc-test"),
		})
		if err != nil {
			return err
		}
		fooUserGroupPolicyAttachment, err := iam.NewUserGroupPolicyAttachment(ctx, "fooUserGroupPolicyAttachment", &iam.UserGroupPolicyAttachmentArgs{
			PolicyName:    fooPolicy.PolicyName,
			PolicyType:    pulumi.String("Custom"),
			UserGroupName: fooUserGroup.UserGroupName,
		})
		if err != nil {
			return err
		}
		_ = iam.UserGroupPolicyAttachmentsOutput(ctx, iam.UserGroupPolicyAttachmentsOutputArgs{
			UserGroupName: fooUserGroupPolicyAttachment.UserGroupName,
		}, nil)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;

return await Deployment.RunAsync(() => 
{
    var fooPolicy = new Volcengine.Iam.Policy("fooPolicy", new()
    {
        PolicyName = "acc-test-policy",
        Description = "acc-test",
        PolicyDocument = "{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}",
    });

    var fooUserGroup = new Volcengine.Iam.UserGroup("fooUserGroup", new()
    {
        UserGroupName = "acc-test-group",
        Description = "acc-test",
        DisplayName = "acc-test",
    });

    var fooUserGroupPolicyAttachment = new Volcengine.Iam.UserGroupPolicyAttachment("fooUserGroupPolicyAttachment", new()
    {
        PolicyName = fooPolicy.PolicyName,
        PolicyType = "Custom",
        UserGroupName = fooUserGroup.UserGroupName,
    });

    var fooUserGroupPolicyAttachments = Volcengine.Iam.UserGroupPolicyAttachments.Invoke(new()
    {
        UserGroupName = fooUserGroupPolicyAttachment.UserGroupName,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.iam.Policy;
import com.pulumi.volcengine.iam.PolicyArgs;
import com.pulumi.volcengine.iam.UserGroup;
import com.pulumi.volcengine.iam.UserGroupArgs;
import com.pulumi.volcengine.iam.UserGroupPolicyAttachment;
import com.pulumi.volcengine.iam.UserGroupPolicyAttachmentArgs;
import com.pulumi.volcengine.iam.IamFunctions;
import com.pulumi.volcengine.iam.inputs.UserGroupPolicyAttachmentsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var fooPolicy = new Policy("fooPolicy", PolicyArgs.builder()        
            .policyName("acc-test-policy")
            .description("acc-test")
            .policyDocument("{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}")
            .build());

        var fooUserGroup = new UserGroup("fooUserGroup", UserGroupArgs.builder()        
            .userGroupName("acc-test-group")
            .description("acc-test")
            .displayName("acc-test")
            .build());

        var fooUserGroupPolicyAttachment = new UserGroupPolicyAttachment("fooUserGroupPolicyAttachment", UserGroupPolicyAttachmentArgs.builder()        
            .policyName(fooPolicy.policyName())
            .policyType("Custom")
            .userGroupName(fooUserGroup.userGroupName())
            .build());

        final var fooUserGroupPolicyAttachments = IamFunctions.UserGroupPolicyAttachments(UserGroupPolicyAttachmentsArgs.builder()
            .userGroupName(fooUserGroupPolicyAttachment.userGroupName())
            .build());

    }
}
Copy
resources:
  fooPolicy:
    type: volcengine:iam:Policy
    properties:
      policyName: acc-test-policy
      description: acc-test
      policyDocument: '{"Statement":[{"Effect":"Allow","Action":["auto_scaling:DescribeScalingGroups"],"Resource":["*"]}]}'
  fooUserGroup:
    type: volcengine:iam:UserGroup
    properties:
      userGroupName: acc-test-group
      description: acc-test
      displayName: acc-test
  fooUserGroupPolicyAttachment:
    type: volcengine:iam:UserGroupPolicyAttachment
    properties:
      policyName: ${fooPolicy.policyName}
      policyType: Custom
      userGroupName: ${fooUserGroup.userGroupName}
variables:
  fooUserGroupPolicyAttachments:
    fn::invoke:
      Function: volcengine:iam:UserGroupPolicyAttachments
      Arguments:
        userGroupName: ${fooUserGroupPolicyAttachment.userGroupName}
Copy

Using UserGroupPolicyAttachments

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function userGroupPolicyAttachments(args: UserGroupPolicyAttachmentsArgs, opts?: InvokeOptions): Promise<UserGroupPolicyAttachmentsResult>
function userGroupPolicyAttachmentsOutput(args: UserGroupPolicyAttachmentsOutputArgs, opts?: InvokeOptions): Output<UserGroupPolicyAttachmentsResult>
Copy
def user_group_policy_attachments(output_file: Optional[str] = None,
                                  user_group_name: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> UserGroupPolicyAttachmentsResult
def user_group_policy_attachments_output(output_file: Optional[pulumi.Input[str]] = None,
                                  user_group_name: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[UserGroupPolicyAttachmentsResult]
Copy
func UserGroupPolicyAttachments(ctx *Context, args *UserGroupPolicyAttachmentsArgs, opts ...InvokeOption) (*UserGroupPolicyAttachmentsResult, error)
func UserGroupPolicyAttachmentsOutput(ctx *Context, args *UserGroupPolicyAttachmentsOutputArgs, opts ...InvokeOption) UserGroupPolicyAttachmentsResultOutput
Copy
public static class UserGroupPolicyAttachments 
{
    public static Task<UserGroupPolicyAttachmentsResult> InvokeAsync(UserGroupPolicyAttachmentsArgs args, InvokeOptions? opts = null)
    public static Output<UserGroupPolicyAttachmentsResult> Invoke(UserGroupPolicyAttachmentsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<UserGroupPolicyAttachmentsResult> userGroupPolicyAttachments(UserGroupPolicyAttachmentsArgs args, InvokeOptions options)
public static Output<UserGroupPolicyAttachmentsResult> userGroupPolicyAttachments(UserGroupPolicyAttachmentsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: volcengine:iam:UserGroupPolicyAttachments
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

UserGroupName This property is required. string
A name of user group.
OutputFile string
File name where to save data source results.
UserGroupName This property is required. string
A name of user group.
OutputFile string
File name where to save data source results.
userGroupName This property is required. String
A name of user group.
outputFile String
File name where to save data source results.
userGroupName This property is required. string
A name of user group.
outputFile string
File name where to save data source results.
user_group_name This property is required. str
A name of user group.
output_file str
File name where to save data source results.
userGroupName This property is required. String
A name of user group.
outputFile String
File name where to save data source results.

UserGroupPolicyAttachments Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Policies List<UserGroupPolicyAttachmentsPolicy>
The collection of query.
TotalCount int
The total count of query.
UserGroupName string
OutputFile string
Id string
The provider-assigned unique ID for this managed resource.
Policies []UserGroupPolicyAttachmentsPolicy
The collection of query.
TotalCount int
The total count of query.
UserGroupName string
OutputFile string
id String
The provider-assigned unique ID for this managed resource.
policies List<UserGroupPolicyAttachmentsPolicy>
The collection of query.
totalCount Integer
The total count of query.
userGroupName String
outputFile String
id string
The provider-assigned unique ID for this managed resource.
policies UserGroupPolicyAttachmentsPolicy[]
The collection of query.
totalCount number
The total count of query.
userGroupName string
outputFile string
id str
The provider-assigned unique ID for this managed resource.
policies Sequence[UserGroupPolicyAttachmentsPolicy]
The collection of query.
total_count int
The total count of query.
user_group_name str
output_file str
id String
The provider-assigned unique ID for this managed resource.
policies List<Property Map>
The collection of query.
totalCount Number
The total count of query.
userGroupName String
outputFile String

Supporting Types

UserGroupPolicyAttachmentsPolicy

AttachDate This property is required. string
Attached time.
Description This property is required. string
The description.
PolicyName This property is required. string
Name of the policy.
PolicyTrn This property is required. string
Resource name of the strategy.
PolicyType This property is required. string
The type of the policy.
AttachDate This property is required. string
Attached time.
Description This property is required. string
The description.
PolicyName This property is required. string
Name of the policy.
PolicyTrn This property is required. string
Resource name of the strategy.
PolicyType This property is required. string
The type of the policy.
attachDate This property is required. String
Attached time.
description This property is required. String
The description.
policyName This property is required. String
Name of the policy.
policyTrn This property is required. String
Resource name of the strategy.
policyType This property is required. String
The type of the policy.
attachDate This property is required. string
Attached time.
description This property is required. string
The description.
policyName This property is required. string
Name of the policy.
policyTrn This property is required. string
Resource name of the strategy.
policyType This property is required. string
The type of the policy.
attach_date This property is required. str
Attached time.
description This property is required. str
The description.
policy_name This property is required. str
Name of the policy.
policy_trn This property is required. str
Resource name of the strategy.
policy_type This property is required. str
The type of the policy.
attachDate This property is required. String
Attached time.
description This property is required. String
The description.
policyName This property is required. String
Name of the policy.
policyTrn This property is required. String
Resource name of the strategy.
policyType This property is required. String
The type of the policy.

Package Details

Repository
volcengine volcengine/pulumi-volcengine
License
Apache-2.0
Notes
This Pulumi package is based on the volcengine Terraform Provider.