1. Packages
  2. Volcengine
  3. API Docs
  4. iam
  5. UserGroupPolicyAttachments
Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine

volcengine.iam.UserGroupPolicyAttachments

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine

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

    Example Usage

    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,
        });
    
    });
    
    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
    	})
    }
    
    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());
    
        }
    }
    
    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)
    
    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,
    });
    
    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}
    

    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>
    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]
    func UserGroupPolicyAttachments(ctx *Context, args *UserGroupPolicyAttachmentsArgs, opts ...InvokeOption) (*UserGroupPolicyAttachmentsResult, error)
    func UserGroupPolicyAttachmentsOutput(ctx *Context, args *UserGroupPolicyAttachmentsOutputArgs, opts ...InvokeOption) UserGroupPolicyAttachmentsResultOutput
    public static class UserGroupPolicyAttachments 
    {
        public static Task<UserGroupPolicyAttachmentsResult> InvokeAsync(UserGroupPolicyAttachmentsArgs args, InvokeOptions? opts = null)
        public static Output<UserGroupPolicyAttachmentsResult> Invoke(UserGroupPolicyAttachmentsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<UserGroupPolicyAttachmentsResult> userGroupPolicyAttachments(UserGroupPolicyAttachmentsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: volcengine:iam:UserGroupPolicyAttachments
      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.

    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 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.26 published on Friday, Sep 13, 2024 by Volcengine