github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ssoadmin/customerManagedPolicyAttachment.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package ssoadmin
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Provides a customer managed policy attachment for a Single Sign-On (SSO) Permission Set resource
    16  //
    17  // > **NOTE:** Creating this resource will automatically [Provision the Permission Set](https://docs.aws.amazon.com/singlesignon/latest/APIReference/API_ProvisionPermissionSet.html) to apply the corresponding updates to all assigned accounts.
    18  //
    19  // ## Import
    20  //
    21  // Using `pulumi import`, import SSO Managed Policy Attachments using the `name`, `path`, `permission_set_arn`, and `instance_arn` separated by a comma (`,`). For example:
    22  //
    23  // ```sh
    24  // $ pulumi import aws:ssoadmin/customerManagedPolicyAttachment:CustomerManagedPolicyAttachment example TestPolicy,/,arn:aws:sso:::permissionSet/ssoins-2938j0x8920sbj72/ps-80383020jr9302rk,arn:aws:sso:::instance/ssoins-2938j0x8920sbj72
    25  // ```
    26  type CustomerManagedPolicyAttachment struct {
    27  	pulumi.CustomResourceState
    28  
    29  	// Specifies the name and path of a customer managed policy. See below.
    30  	CustomerManagedPolicyReference CustomerManagedPolicyAttachmentCustomerManagedPolicyReferenceOutput `pulumi:"customerManagedPolicyReference"`
    31  	// The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
    32  	InstanceArn pulumi.StringOutput `pulumi:"instanceArn"`
    33  	// The Amazon Resource Name (ARN) of the Permission Set.
    34  	PermissionSetArn pulumi.StringOutput `pulumi:"permissionSetArn"`
    35  }
    36  
    37  // NewCustomerManagedPolicyAttachment registers a new resource with the given unique name, arguments, and options.
    38  func NewCustomerManagedPolicyAttachment(ctx *pulumi.Context,
    39  	name string, args *CustomerManagedPolicyAttachmentArgs, opts ...pulumi.ResourceOption) (*CustomerManagedPolicyAttachment, error) {
    40  	if args == nil {
    41  		return nil, errors.New("missing one or more required arguments")
    42  	}
    43  
    44  	if args.CustomerManagedPolicyReference == nil {
    45  		return nil, errors.New("invalid value for required argument 'CustomerManagedPolicyReference'")
    46  	}
    47  	if args.InstanceArn == nil {
    48  		return nil, errors.New("invalid value for required argument 'InstanceArn'")
    49  	}
    50  	if args.PermissionSetArn == nil {
    51  		return nil, errors.New("invalid value for required argument 'PermissionSetArn'")
    52  	}
    53  	opts = internal.PkgResourceDefaultOpts(opts)
    54  	var resource CustomerManagedPolicyAttachment
    55  	err := ctx.RegisterResource("aws:ssoadmin/customerManagedPolicyAttachment:CustomerManagedPolicyAttachment", name, args, &resource, opts...)
    56  	if err != nil {
    57  		return nil, err
    58  	}
    59  	return &resource, nil
    60  }
    61  
    62  // GetCustomerManagedPolicyAttachment gets an existing CustomerManagedPolicyAttachment resource's state with the given name, ID, and optional
    63  // state properties that are used to uniquely qualify the lookup (nil if not required).
    64  func GetCustomerManagedPolicyAttachment(ctx *pulumi.Context,
    65  	name string, id pulumi.IDInput, state *CustomerManagedPolicyAttachmentState, opts ...pulumi.ResourceOption) (*CustomerManagedPolicyAttachment, error) {
    66  	var resource CustomerManagedPolicyAttachment
    67  	err := ctx.ReadResource("aws:ssoadmin/customerManagedPolicyAttachment:CustomerManagedPolicyAttachment", name, id, state, &resource, opts...)
    68  	if err != nil {
    69  		return nil, err
    70  	}
    71  	return &resource, nil
    72  }
    73  
    74  // Input properties used for looking up and filtering CustomerManagedPolicyAttachment resources.
    75  type customerManagedPolicyAttachmentState struct {
    76  	// Specifies the name and path of a customer managed policy. See below.
    77  	CustomerManagedPolicyReference *CustomerManagedPolicyAttachmentCustomerManagedPolicyReference `pulumi:"customerManagedPolicyReference"`
    78  	// The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
    79  	InstanceArn *string `pulumi:"instanceArn"`
    80  	// The Amazon Resource Name (ARN) of the Permission Set.
    81  	PermissionSetArn *string `pulumi:"permissionSetArn"`
    82  }
    83  
    84  type CustomerManagedPolicyAttachmentState struct {
    85  	// Specifies the name and path of a customer managed policy. See below.
    86  	CustomerManagedPolicyReference CustomerManagedPolicyAttachmentCustomerManagedPolicyReferencePtrInput
    87  	// The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
    88  	InstanceArn pulumi.StringPtrInput
    89  	// The Amazon Resource Name (ARN) of the Permission Set.
    90  	PermissionSetArn pulumi.StringPtrInput
    91  }
    92  
    93  func (CustomerManagedPolicyAttachmentState) ElementType() reflect.Type {
    94  	return reflect.TypeOf((*customerManagedPolicyAttachmentState)(nil)).Elem()
    95  }
    96  
    97  type customerManagedPolicyAttachmentArgs struct {
    98  	// Specifies the name and path of a customer managed policy. See below.
    99  	CustomerManagedPolicyReference CustomerManagedPolicyAttachmentCustomerManagedPolicyReference `pulumi:"customerManagedPolicyReference"`
   100  	// The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
   101  	InstanceArn string `pulumi:"instanceArn"`
   102  	// The Amazon Resource Name (ARN) of the Permission Set.
   103  	PermissionSetArn string `pulumi:"permissionSetArn"`
   104  }
   105  
   106  // The set of arguments for constructing a CustomerManagedPolicyAttachment resource.
   107  type CustomerManagedPolicyAttachmentArgs struct {
   108  	// Specifies the name and path of a customer managed policy. See below.
   109  	CustomerManagedPolicyReference CustomerManagedPolicyAttachmentCustomerManagedPolicyReferenceInput
   110  	// The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
   111  	InstanceArn pulumi.StringInput
   112  	// The Amazon Resource Name (ARN) of the Permission Set.
   113  	PermissionSetArn pulumi.StringInput
   114  }
   115  
   116  func (CustomerManagedPolicyAttachmentArgs) ElementType() reflect.Type {
   117  	return reflect.TypeOf((*customerManagedPolicyAttachmentArgs)(nil)).Elem()
   118  }
   119  
   120  type CustomerManagedPolicyAttachmentInput interface {
   121  	pulumi.Input
   122  
   123  	ToCustomerManagedPolicyAttachmentOutput() CustomerManagedPolicyAttachmentOutput
   124  	ToCustomerManagedPolicyAttachmentOutputWithContext(ctx context.Context) CustomerManagedPolicyAttachmentOutput
   125  }
   126  
   127  func (*CustomerManagedPolicyAttachment) ElementType() reflect.Type {
   128  	return reflect.TypeOf((**CustomerManagedPolicyAttachment)(nil)).Elem()
   129  }
   130  
   131  func (i *CustomerManagedPolicyAttachment) ToCustomerManagedPolicyAttachmentOutput() CustomerManagedPolicyAttachmentOutput {
   132  	return i.ToCustomerManagedPolicyAttachmentOutputWithContext(context.Background())
   133  }
   134  
   135  func (i *CustomerManagedPolicyAttachment) ToCustomerManagedPolicyAttachmentOutputWithContext(ctx context.Context) CustomerManagedPolicyAttachmentOutput {
   136  	return pulumi.ToOutputWithContext(ctx, i).(CustomerManagedPolicyAttachmentOutput)
   137  }
   138  
   139  // CustomerManagedPolicyAttachmentArrayInput is an input type that accepts CustomerManagedPolicyAttachmentArray and CustomerManagedPolicyAttachmentArrayOutput values.
   140  // You can construct a concrete instance of `CustomerManagedPolicyAttachmentArrayInput` via:
   141  //
   142  //	CustomerManagedPolicyAttachmentArray{ CustomerManagedPolicyAttachmentArgs{...} }
   143  type CustomerManagedPolicyAttachmentArrayInput interface {
   144  	pulumi.Input
   145  
   146  	ToCustomerManagedPolicyAttachmentArrayOutput() CustomerManagedPolicyAttachmentArrayOutput
   147  	ToCustomerManagedPolicyAttachmentArrayOutputWithContext(context.Context) CustomerManagedPolicyAttachmentArrayOutput
   148  }
   149  
   150  type CustomerManagedPolicyAttachmentArray []CustomerManagedPolicyAttachmentInput
   151  
   152  func (CustomerManagedPolicyAttachmentArray) ElementType() reflect.Type {
   153  	return reflect.TypeOf((*[]*CustomerManagedPolicyAttachment)(nil)).Elem()
   154  }
   155  
   156  func (i CustomerManagedPolicyAttachmentArray) ToCustomerManagedPolicyAttachmentArrayOutput() CustomerManagedPolicyAttachmentArrayOutput {
   157  	return i.ToCustomerManagedPolicyAttachmentArrayOutputWithContext(context.Background())
   158  }
   159  
   160  func (i CustomerManagedPolicyAttachmentArray) ToCustomerManagedPolicyAttachmentArrayOutputWithContext(ctx context.Context) CustomerManagedPolicyAttachmentArrayOutput {
   161  	return pulumi.ToOutputWithContext(ctx, i).(CustomerManagedPolicyAttachmentArrayOutput)
   162  }
   163  
   164  // CustomerManagedPolicyAttachmentMapInput is an input type that accepts CustomerManagedPolicyAttachmentMap and CustomerManagedPolicyAttachmentMapOutput values.
   165  // You can construct a concrete instance of `CustomerManagedPolicyAttachmentMapInput` via:
   166  //
   167  //	CustomerManagedPolicyAttachmentMap{ "key": CustomerManagedPolicyAttachmentArgs{...} }
   168  type CustomerManagedPolicyAttachmentMapInput interface {
   169  	pulumi.Input
   170  
   171  	ToCustomerManagedPolicyAttachmentMapOutput() CustomerManagedPolicyAttachmentMapOutput
   172  	ToCustomerManagedPolicyAttachmentMapOutputWithContext(context.Context) CustomerManagedPolicyAttachmentMapOutput
   173  }
   174  
   175  type CustomerManagedPolicyAttachmentMap map[string]CustomerManagedPolicyAttachmentInput
   176  
   177  func (CustomerManagedPolicyAttachmentMap) ElementType() reflect.Type {
   178  	return reflect.TypeOf((*map[string]*CustomerManagedPolicyAttachment)(nil)).Elem()
   179  }
   180  
   181  func (i CustomerManagedPolicyAttachmentMap) ToCustomerManagedPolicyAttachmentMapOutput() CustomerManagedPolicyAttachmentMapOutput {
   182  	return i.ToCustomerManagedPolicyAttachmentMapOutputWithContext(context.Background())
   183  }
   184  
   185  func (i CustomerManagedPolicyAttachmentMap) ToCustomerManagedPolicyAttachmentMapOutputWithContext(ctx context.Context) CustomerManagedPolicyAttachmentMapOutput {
   186  	return pulumi.ToOutputWithContext(ctx, i).(CustomerManagedPolicyAttachmentMapOutput)
   187  }
   188  
   189  type CustomerManagedPolicyAttachmentOutput struct{ *pulumi.OutputState }
   190  
   191  func (CustomerManagedPolicyAttachmentOutput) ElementType() reflect.Type {
   192  	return reflect.TypeOf((**CustomerManagedPolicyAttachment)(nil)).Elem()
   193  }
   194  
   195  func (o CustomerManagedPolicyAttachmentOutput) ToCustomerManagedPolicyAttachmentOutput() CustomerManagedPolicyAttachmentOutput {
   196  	return o
   197  }
   198  
   199  func (o CustomerManagedPolicyAttachmentOutput) ToCustomerManagedPolicyAttachmentOutputWithContext(ctx context.Context) CustomerManagedPolicyAttachmentOutput {
   200  	return o
   201  }
   202  
   203  // Specifies the name and path of a customer managed policy. See below.
   204  func (o CustomerManagedPolicyAttachmentOutput) CustomerManagedPolicyReference() CustomerManagedPolicyAttachmentCustomerManagedPolicyReferenceOutput {
   205  	return o.ApplyT(func(v *CustomerManagedPolicyAttachment) CustomerManagedPolicyAttachmentCustomerManagedPolicyReferenceOutput {
   206  		return v.CustomerManagedPolicyReference
   207  	}).(CustomerManagedPolicyAttachmentCustomerManagedPolicyReferenceOutput)
   208  }
   209  
   210  // The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
   211  func (o CustomerManagedPolicyAttachmentOutput) InstanceArn() pulumi.StringOutput {
   212  	return o.ApplyT(func(v *CustomerManagedPolicyAttachment) pulumi.StringOutput { return v.InstanceArn }).(pulumi.StringOutput)
   213  }
   214  
   215  // The Amazon Resource Name (ARN) of the Permission Set.
   216  func (o CustomerManagedPolicyAttachmentOutput) PermissionSetArn() pulumi.StringOutput {
   217  	return o.ApplyT(func(v *CustomerManagedPolicyAttachment) pulumi.StringOutput { return v.PermissionSetArn }).(pulumi.StringOutput)
   218  }
   219  
   220  type CustomerManagedPolicyAttachmentArrayOutput struct{ *pulumi.OutputState }
   221  
   222  func (CustomerManagedPolicyAttachmentArrayOutput) ElementType() reflect.Type {
   223  	return reflect.TypeOf((*[]*CustomerManagedPolicyAttachment)(nil)).Elem()
   224  }
   225  
   226  func (o CustomerManagedPolicyAttachmentArrayOutput) ToCustomerManagedPolicyAttachmentArrayOutput() CustomerManagedPolicyAttachmentArrayOutput {
   227  	return o
   228  }
   229  
   230  func (o CustomerManagedPolicyAttachmentArrayOutput) ToCustomerManagedPolicyAttachmentArrayOutputWithContext(ctx context.Context) CustomerManagedPolicyAttachmentArrayOutput {
   231  	return o
   232  }
   233  
   234  func (o CustomerManagedPolicyAttachmentArrayOutput) Index(i pulumi.IntInput) CustomerManagedPolicyAttachmentOutput {
   235  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CustomerManagedPolicyAttachment {
   236  		return vs[0].([]*CustomerManagedPolicyAttachment)[vs[1].(int)]
   237  	}).(CustomerManagedPolicyAttachmentOutput)
   238  }
   239  
   240  type CustomerManagedPolicyAttachmentMapOutput struct{ *pulumi.OutputState }
   241  
   242  func (CustomerManagedPolicyAttachmentMapOutput) ElementType() reflect.Type {
   243  	return reflect.TypeOf((*map[string]*CustomerManagedPolicyAttachment)(nil)).Elem()
   244  }
   245  
   246  func (o CustomerManagedPolicyAttachmentMapOutput) ToCustomerManagedPolicyAttachmentMapOutput() CustomerManagedPolicyAttachmentMapOutput {
   247  	return o
   248  }
   249  
   250  func (o CustomerManagedPolicyAttachmentMapOutput) ToCustomerManagedPolicyAttachmentMapOutputWithContext(ctx context.Context) CustomerManagedPolicyAttachmentMapOutput {
   251  	return o
   252  }
   253  
   254  func (o CustomerManagedPolicyAttachmentMapOutput) MapIndex(k pulumi.StringInput) CustomerManagedPolicyAttachmentOutput {
   255  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CustomerManagedPolicyAttachment {
   256  		return vs[0].(map[string]*CustomerManagedPolicyAttachment)[vs[1].(string)]
   257  	}).(CustomerManagedPolicyAttachmentOutput)
   258  }
   259  
   260  func init() {
   261  	pulumi.RegisterInputType(reflect.TypeOf((*CustomerManagedPolicyAttachmentInput)(nil)).Elem(), &CustomerManagedPolicyAttachment{})
   262  	pulumi.RegisterInputType(reflect.TypeOf((*CustomerManagedPolicyAttachmentArrayInput)(nil)).Elem(), CustomerManagedPolicyAttachmentArray{})
   263  	pulumi.RegisterInputType(reflect.TypeOf((*CustomerManagedPolicyAttachmentMapInput)(nil)).Elem(), CustomerManagedPolicyAttachmentMap{})
   264  	pulumi.RegisterOutputType(CustomerManagedPolicyAttachmentOutput{})
   265  	pulumi.RegisterOutputType(CustomerManagedPolicyAttachmentArrayOutput{})
   266  	pulumi.RegisterOutputType(CustomerManagedPolicyAttachmentMapOutput{})
   267  }