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,
});
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)
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
	})
}
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 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());
    }
}
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) UserGroupPolicyAttachmentsResultOutputpublic 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)
public static Output<UserGroupPolicyAttachmentsResult> userGroupPolicyAttachments(UserGroupPolicyAttachmentsArgs args, InvokeOptions options)
fn::invoke:
  function: volcengine:iam:UserGroupPolicyAttachments
  arguments:
    # arguments dictionaryThe following arguments are supported:
- UserGroup stringName 
- A name of user group.
- OutputFile string
- File name where to save data source results.
- UserGroup stringName 
- A name of user group.
- OutputFile string
- File name where to save data source results.
- userGroup StringName 
- A name of user group.
- outputFile String
- File name where to save data source results.
- userGroup stringName 
- A name of user group.
- outputFile string
- File name where to save data source results.
- user_group_ strname 
- A name of user group.
- output_file str
- File name where to save data source results.
- userGroup StringName 
- 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<UserGroup Policy Attachments Policy> 
- The collection of query.
- TotalCount int
- The total count of query.
- UserGroup stringName 
- OutputFile string
- Id string
- The provider-assigned unique ID for this managed resource.
- Policies
[]UserGroup Policy Attachments Policy 
- The collection of query.
- TotalCount int
- The total count of query.
- UserGroup stringName 
- OutputFile string
- id String
- The provider-assigned unique ID for this managed resource.
- policies
List<UserGroup Policy Attachments Policy> 
- The collection of query.
- totalCount Integer
- The total count of query.
- userGroup StringName 
- outputFile String
- id string
- The provider-assigned unique ID for this managed resource.
- policies
UserGroup Policy Attachments Policy[] 
- The collection of query.
- totalCount number
- The total count of query.
- userGroup stringName 
- outputFile string
- id str
- The provider-assigned unique ID for this managed resource.
- policies
Sequence[UserGroup Policy Attachments Policy] 
- The collection of query.
- total_count int
- The total count of query.
- user_group_ strname 
- 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.
- userGroup StringName 
- 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 volcengineTerraform Provider.