1. Packages
  2. Volcengine
  3. API Docs
  4. iam
  5. getUserGroupPolicyAttachments
Volcengine v0.0.31 published on Monday, May 12, 2025 by Volcengine

volcengine.iam.getUserGroupPolicyAttachments

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.31 published on Monday, May 12, 2025 by Volcengine

    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.getUserGroupPolicyAttachmentsOutput({
        userGroupName: fooUserGroupPolicyAttachment.userGroupName,
    });
    
    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.get_user_group_policy_attachments_output(user_group_name=foo_user_group_policy_attachment.user_group_name)
    
    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.GetUserGroupPolicyAttachmentsOutput(ctx, iam.GetUserGroupPolicyAttachmentsOutputArgs{
    			UserGroupName: fooUserGroupPolicyAttachment.UserGroupName,
    		}, nil)
    		return nil
    	})
    }
    
    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.GetUserGroupPolicyAttachments.Invoke(new()
        {
            UserGroupName = fooUserGroupPolicyAttachment.UserGroupName,
        });
    
    });
    
    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.GetUserGroupPolicyAttachmentsArgs;
    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.getUserGroupPolicyAttachments(GetUserGroupPolicyAttachmentsArgs.builder()
                .userGroupName(fooUserGroupPolicyAttachment.userGroupName())
                .build());
    
        }
    }
    
    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:getUserGroupPolicyAttachments
          Arguments:
            userGroupName: ${fooUserGroupPolicyAttachment.userGroupName}
    

    Using getUserGroupPolicyAttachments

    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 getUserGroupPolicyAttachments(args: GetUserGroupPolicyAttachmentsArgs, opts?: InvokeOptions): Promise<GetUserGroupPolicyAttachmentsResult>
    function getUserGroupPolicyAttachmentsOutput(args: GetUserGroupPolicyAttachmentsOutputArgs, opts?: InvokeOptions): Output<GetUserGroupPolicyAttachmentsResult>
    def get_user_group_policy_attachments(output_file: Optional[str] = None,
                                          user_group_name: Optional[str] = None,
                                          opts: Optional[InvokeOptions] = None) -> GetUserGroupPolicyAttachmentsResult
    def get_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[GetUserGroupPolicyAttachmentsResult]
    func GetUserGroupPolicyAttachments(ctx *Context, args *GetUserGroupPolicyAttachmentsArgs, opts ...InvokeOption) (*GetUserGroupPolicyAttachmentsResult, error)
    func GetUserGroupPolicyAttachmentsOutput(ctx *Context, args *GetUserGroupPolicyAttachmentsOutputArgs, opts ...InvokeOption) GetUserGroupPolicyAttachmentsResultOutput

    > Note: This function is named GetUserGroupPolicyAttachments in the Go SDK.

    public static class GetUserGroupPolicyAttachments 
    {
        public static Task<GetUserGroupPolicyAttachmentsResult> InvokeAsync(GetUserGroupPolicyAttachmentsArgs args, InvokeOptions? opts = null)
        public static Output<GetUserGroupPolicyAttachmentsResult> Invoke(GetUserGroupPolicyAttachmentsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetUserGroupPolicyAttachmentsResult> getUserGroupPolicyAttachments(GetUserGroupPolicyAttachmentsArgs args, InvokeOptions options)
    public static Output<GetUserGroupPolicyAttachmentsResult> getUserGroupPolicyAttachments(GetUserGroupPolicyAttachmentsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: volcengine:iam/getUserGroupPolicyAttachments:getUserGroupPolicyAttachments
      arguments:
        # arguments dictionary

    The following arguments are supported:

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

    getUserGroupPolicyAttachments Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Policies List<GetUserGroupPolicyAttachmentsPolicy>
    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 []GetUserGroupPolicyAttachmentsPolicy
    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<GetUserGroupPolicyAttachmentsPolicy>
    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 GetUserGroupPolicyAttachmentsPolicy[]
    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[GetUserGroupPolicyAttachmentsPolicy]
    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

    GetUserGroupPolicyAttachmentsPolicy

    AttachDate string
    Attached time.
    Description string
    The description.
    PolicyName string
    Name of the policy.
    PolicyTrn string
    Resource name of the strategy.
    PolicyType string
    The type of the policy.
    AttachDate string
    Attached time.
    Description string
    The description.
    PolicyName string
    Name of the policy.
    PolicyTrn string
    Resource name of the strategy.
    PolicyType string
    The type of the policy.
    attachDate String
    Attached time.
    description String
    The description.
    policyName String
    Name of the policy.
    policyTrn String
    Resource name of the strategy.
    policyType String
    The type of the policy.
    attachDate string
    Attached time.
    description string
    The description.
    policyName string
    Name of the policy.
    policyTrn string
    Resource name of the strategy.
    policyType string
    The type of the policy.
    attach_date str
    Attached time.
    description str
    The description.
    policy_name str
    Name of the policy.
    policy_trn str
    Resource name of the strategy.
    policy_type str
    The type of the policy.
    attachDate String
    Attached time.
    description String
    The description.
    policyName String
    Name of the policy.
    policyTrn String
    Resource name of the strategy.
    policyType 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.
    volcengine logo
    Volcengine v0.0.31 published on Monday, May 12, 2025 by Volcengine