github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ssoadmin/permissionSet.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 Single Sign-On (SSO) Permission Set resource
    16  //
    17  // > **NOTE:** Updating 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 Permission Sets using the `arn` and `instance_arn` separated by a comma (`,`). For example:
    22  //
    23  // ```sh
    24  // $ pulumi import aws:ssoadmin/permissionSet:PermissionSet example arn:aws:sso:::permissionSet/ssoins-2938j0x8920sbj72/ps-80383020jr9302rk,arn:aws:sso:::instance/ssoins-2938j0x8920sbj72
    25  // ```
    26  type PermissionSet struct {
    27  	pulumi.CustomResourceState
    28  
    29  	// The Amazon Resource Name (ARN) of the Permission Set.
    30  	Arn pulumi.StringOutput `pulumi:"arn"`
    31  	// The date the Permission Set was created in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8).
    32  	CreatedDate pulumi.StringOutput `pulumi:"createdDate"`
    33  	// The description of the Permission Set.
    34  	Description pulumi.StringPtrOutput `pulumi:"description"`
    35  	// The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
    36  	InstanceArn pulumi.StringOutput `pulumi:"instanceArn"`
    37  	// The name of the Permission Set.
    38  	Name pulumi.StringOutput `pulumi:"name"`
    39  	// The relay state URL used to redirect users within the application during the federation authentication process.
    40  	RelayState pulumi.StringPtrOutput `pulumi:"relayState"`
    41  	// The length of time that the application user sessions are valid in the ISO-8601 standard. Default: `PT1H`.
    42  	SessionDuration pulumi.StringPtrOutput `pulumi:"sessionDuration"`
    43  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    44  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    45  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    46  	//
    47  	// Deprecated: Please use `tags` instead.
    48  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    49  }
    50  
    51  // NewPermissionSet registers a new resource with the given unique name, arguments, and options.
    52  func NewPermissionSet(ctx *pulumi.Context,
    53  	name string, args *PermissionSetArgs, opts ...pulumi.ResourceOption) (*PermissionSet, error) {
    54  	if args == nil {
    55  		return nil, errors.New("missing one or more required arguments")
    56  	}
    57  
    58  	if args.InstanceArn == nil {
    59  		return nil, errors.New("invalid value for required argument 'InstanceArn'")
    60  	}
    61  	opts = internal.PkgResourceDefaultOpts(opts)
    62  	var resource PermissionSet
    63  	err := ctx.RegisterResource("aws:ssoadmin/permissionSet:PermissionSet", name, args, &resource, opts...)
    64  	if err != nil {
    65  		return nil, err
    66  	}
    67  	return &resource, nil
    68  }
    69  
    70  // GetPermissionSet gets an existing PermissionSet resource's state with the given name, ID, and optional
    71  // state properties that are used to uniquely qualify the lookup (nil if not required).
    72  func GetPermissionSet(ctx *pulumi.Context,
    73  	name string, id pulumi.IDInput, state *PermissionSetState, opts ...pulumi.ResourceOption) (*PermissionSet, error) {
    74  	var resource PermissionSet
    75  	err := ctx.ReadResource("aws:ssoadmin/permissionSet:PermissionSet", name, id, state, &resource, opts...)
    76  	if err != nil {
    77  		return nil, err
    78  	}
    79  	return &resource, nil
    80  }
    81  
    82  // Input properties used for looking up and filtering PermissionSet resources.
    83  type permissionSetState struct {
    84  	// The Amazon Resource Name (ARN) of the Permission Set.
    85  	Arn *string `pulumi:"arn"`
    86  	// The date the Permission Set was created in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8).
    87  	CreatedDate *string `pulumi:"createdDate"`
    88  	// The description of the Permission Set.
    89  	Description *string `pulumi:"description"`
    90  	// The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
    91  	InstanceArn *string `pulumi:"instanceArn"`
    92  	// The name of the Permission Set.
    93  	Name *string `pulumi:"name"`
    94  	// The relay state URL used to redirect users within the application during the federation authentication process.
    95  	RelayState *string `pulumi:"relayState"`
    96  	// The length of time that the application user sessions are valid in the ISO-8601 standard. Default: `PT1H`.
    97  	SessionDuration *string `pulumi:"sessionDuration"`
    98  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    99  	Tags map[string]string `pulumi:"tags"`
   100  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   101  	//
   102  	// Deprecated: Please use `tags` instead.
   103  	TagsAll map[string]string `pulumi:"tagsAll"`
   104  }
   105  
   106  type PermissionSetState struct {
   107  	// The Amazon Resource Name (ARN) of the Permission Set.
   108  	Arn pulumi.StringPtrInput
   109  	// The date the Permission Set was created in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8).
   110  	CreatedDate pulumi.StringPtrInput
   111  	// The description of the Permission Set.
   112  	Description pulumi.StringPtrInput
   113  	// The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
   114  	InstanceArn pulumi.StringPtrInput
   115  	// The name of the Permission Set.
   116  	Name pulumi.StringPtrInput
   117  	// The relay state URL used to redirect users within the application during the federation authentication process.
   118  	RelayState pulumi.StringPtrInput
   119  	// The length of time that the application user sessions are valid in the ISO-8601 standard. Default: `PT1H`.
   120  	SessionDuration pulumi.StringPtrInput
   121  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   122  	Tags pulumi.StringMapInput
   123  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   124  	//
   125  	// Deprecated: Please use `tags` instead.
   126  	TagsAll pulumi.StringMapInput
   127  }
   128  
   129  func (PermissionSetState) ElementType() reflect.Type {
   130  	return reflect.TypeOf((*permissionSetState)(nil)).Elem()
   131  }
   132  
   133  type permissionSetArgs struct {
   134  	// The description of the Permission Set.
   135  	Description *string `pulumi:"description"`
   136  	// The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
   137  	InstanceArn string `pulumi:"instanceArn"`
   138  	// The name of the Permission Set.
   139  	Name *string `pulumi:"name"`
   140  	// The relay state URL used to redirect users within the application during the federation authentication process.
   141  	RelayState *string `pulumi:"relayState"`
   142  	// The length of time that the application user sessions are valid in the ISO-8601 standard. Default: `PT1H`.
   143  	SessionDuration *string `pulumi:"sessionDuration"`
   144  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   145  	Tags map[string]string `pulumi:"tags"`
   146  }
   147  
   148  // The set of arguments for constructing a PermissionSet resource.
   149  type PermissionSetArgs struct {
   150  	// The description of the Permission Set.
   151  	Description pulumi.StringPtrInput
   152  	// The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
   153  	InstanceArn pulumi.StringInput
   154  	// The name of the Permission Set.
   155  	Name pulumi.StringPtrInput
   156  	// The relay state URL used to redirect users within the application during the federation authentication process.
   157  	RelayState pulumi.StringPtrInput
   158  	// The length of time that the application user sessions are valid in the ISO-8601 standard. Default: `PT1H`.
   159  	SessionDuration pulumi.StringPtrInput
   160  	// Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   161  	Tags pulumi.StringMapInput
   162  }
   163  
   164  func (PermissionSetArgs) ElementType() reflect.Type {
   165  	return reflect.TypeOf((*permissionSetArgs)(nil)).Elem()
   166  }
   167  
   168  type PermissionSetInput interface {
   169  	pulumi.Input
   170  
   171  	ToPermissionSetOutput() PermissionSetOutput
   172  	ToPermissionSetOutputWithContext(ctx context.Context) PermissionSetOutput
   173  }
   174  
   175  func (*PermissionSet) ElementType() reflect.Type {
   176  	return reflect.TypeOf((**PermissionSet)(nil)).Elem()
   177  }
   178  
   179  func (i *PermissionSet) ToPermissionSetOutput() PermissionSetOutput {
   180  	return i.ToPermissionSetOutputWithContext(context.Background())
   181  }
   182  
   183  func (i *PermissionSet) ToPermissionSetOutputWithContext(ctx context.Context) PermissionSetOutput {
   184  	return pulumi.ToOutputWithContext(ctx, i).(PermissionSetOutput)
   185  }
   186  
   187  // PermissionSetArrayInput is an input type that accepts PermissionSetArray and PermissionSetArrayOutput values.
   188  // You can construct a concrete instance of `PermissionSetArrayInput` via:
   189  //
   190  //	PermissionSetArray{ PermissionSetArgs{...} }
   191  type PermissionSetArrayInput interface {
   192  	pulumi.Input
   193  
   194  	ToPermissionSetArrayOutput() PermissionSetArrayOutput
   195  	ToPermissionSetArrayOutputWithContext(context.Context) PermissionSetArrayOutput
   196  }
   197  
   198  type PermissionSetArray []PermissionSetInput
   199  
   200  func (PermissionSetArray) ElementType() reflect.Type {
   201  	return reflect.TypeOf((*[]*PermissionSet)(nil)).Elem()
   202  }
   203  
   204  func (i PermissionSetArray) ToPermissionSetArrayOutput() PermissionSetArrayOutput {
   205  	return i.ToPermissionSetArrayOutputWithContext(context.Background())
   206  }
   207  
   208  func (i PermissionSetArray) ToPermissionSetArrayOutputWithContext(ctx context.Context) PermissionSetArrayOutput {
   209  	return pulumi.ToOutputWithContext(ctx, i).(PermissionSetArrayOutput)
   210  }
   211  
   212  // PermissionSetMapInput is an input type that accepts PermissionSetMap and PermissionSetMapOutput values.
   213  // You can construct a concrete instance of `PermissionSetMapInput` via:
   214  //
   215  //	PermissionSetMap{ "key": PermissionSetArgs{...} }
   216  type PermissionSetMapInput interface {
   217  	pulumi.Input
   218  
   219  	ToPermissionSetMapOutput() PermissionSetMapOutput
   220  	ToPermissionSetMapOutputWithContext(context.Context) PermissionSetMapOutput
   221  }
   222  
   223  type PermissionSetMap map[string]PermissionSetInput
   224  
   225  func (PermissionSetMap) ElementType() reflect.Type {
   226  	return reflect.TypeOf((*map[string]*PermissionSet)(nil)).Elem()
   227  }
   228  
   229  func (i PermissionSetMap) ToPermissionSetMapOutput() PermissionSetMapOutput {
   230  	return i.ToPermissionSetMapOutputWithContext(context.Background())
   231  }
   232  
   233  func (i PermissionSetMap) ToPermissionSetMapOutputWithContext(ctx context.Context) PermissionSetMapOutput {
   234  	return pulumi.ToOutputWithContext(ctx, i).(PermissionSetMapOutput)
   235  }
   236  
   237  type PermissionSetOutput struct{ *pulumi.OutputState }
   238  
   239  func (PermissionSetOutput) ElementType() reflect.Type {
   240  	return reflect.TypeOf((**PermissionSet)(nil)).Elem()
   241  }
   242  
   243  func (o PermissionSetOutput) ToPermissionSetOutput() PermissionSetOutput {
   244  	return o
   245  }
   246  
   247  func (o PermissionSetOutput) ToPermissionSetOutputWithContext(ctx context.Context) PermissionSetOutput {
   248  	return o
   249  }
   250  
   251  // The Amazon Resource Name (ARN) of the Permission Set.
   252  func (o PermissionSetOutput) Arn() pulumi.StringOutput {
   253  	return o.ApplyT(func(v *PermissionSet) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   254  }
   255  
   256  // The date the Permission Set was created in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8).
   257  func (o PermissionSetOutput) CreatedDate() pulumi.StringOutput {
   258  	return o.ApplyT(func(v *PermissionSet) pulumi.StringOutput { return v.CreatedDate }).(pulumi.StringOutput)
   259  }
   260  
   261  // The description of the Permission Set.
   262  func (o PermissionSetOutput) Description() pulumi.StringPtrOutput {
   263  	return o.ApplyT(func(v *PermissionSet) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   264  }
   265  
   266  // The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed.
   267  func (o PermissionSetOutput) InstanceArn() pulumi.StringOutput {
   268  	return o.ApplyT(func(v *PermissionSet) pulumi.StringOutput { return v.InstanceArn }).(pulumi.StringOutput)
   269  }
   270  
   271  // The name of the Permission Set.
   272  func (o PermissionSetOutput) Name() pulumi.StringOutput {
   273  	return o.ApplyT(func(v *PermissionSet) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   274  }
   275  
   276  // The relay state URL used to redirect users within the application during the federation authentication process.
   277  func (o PermissionSetOutput) RelayState() pulumi.StringPtrOutput {
   278  	return o.ApplyT(func(v *PermissionSet) pulumi.StringPtrOutput { return v.RelayState }).(pulumi.StringPtrOutput)
   279  }
   280  
   281  // The length of time that the application user sessions are valid in the ISO-8601 standard. Default: `PT1H`.
   282  func (o PermissionSetOutput) SessionDuration() pulumi.StringPtrOutput {
   283  	return o.ApplyT(func(v *PermissionSet) pulumi.StringPtrOutput { return v.SessionDuration }).(pulumi.StringPtrOutput)
   284  }
   285  
   286  // Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   287  func (o PermissionSetOutput) Tags() pulumi.StringMapOutput {
   288  	return o.ApplyT(func(v *PermissionSet) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   289  }
   290  
   291  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   292  //
   293  // Deprecated: Please use `tags` instead.
   294  func (o PermissionSetOutput) TagsAll() pulumi.StringMapOutput {
   295  	return o.ApplyT(func(v *PermissionSet) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   296  }
   297  
   298  type PermissionSetArrayOutput struct{ *pulumi.OutputState }
   299  
   300  func (PermissionSetArrayOutput) ElementType() reflect.Type {
   301  	return reflect.TypeOf((*[]*PermissionSet)(nil)).Elem()
   302  }
   303  
   304  func (o PermissionSetArrayOutput) ToPermissionSetArrayOutput() PermissionSetArrayOutput {
   305  	return o
   306  }
   307  
   308  func (o PermissionSetArrayOutput) ToPermissionSetArrayOutputWithContext(ctx context.Context) PermissionSetArrayOutput {
   309  	return o
   310  }
   311  
   312  func (o PermissionSetArrayOutput) Index(i pulumi.IntInput) PermissionSetOutput {
   313  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PermissionSet {
   314  		return vs[0].([]*PermissionSet)[vs[1].(int)]
   315  	}).(PermissionSetOutput)
   316  }
   317  
   318  type PermissionSetMapOutput struct{ *pulumi.OutputState }
   319  
   320  func (PermissionSetMapOutput) ElementType() reflect.Type {
   321  	return reflect.TypeOf((*map[string]*PermissionSet)(nil)).Elem()
   322  }
   323  
   324  func (o PermissionSetMapOutput) ToPermissionSetMapOutput() PermissionSetMapOutput {
   325  	return o
   326  }
   327  
   328  func (o PermissionSetMapOutput) ToPermissionSetMapOutputWithContext(ctx context.Context) PermissionSetMapOutput {
   329  	return o
   330  }
   331  
   332  func (o PermissionSetMapOutput) MapIndex(k pulumi.StringInput) PermissionSetOutput {
   333  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PermissionSet {
   334  		return vs[0].(map[string]*PermissionSet)[vs[1].(string)]
   335  	}).(PermissionSetOutput)
   336  }
   337  
   338  func init() {
   339  	pulumi.RegisterInputType(reflect.TypeOf((*PermissionSetInput)(nil)).Elem(), &PermissionSet{})
   340  	pulumi.RegisterInputType(reflect.TypeOf((*PermissionSetArrayInput)(nil)).Elem(), PermissionSetArray{})
   341  	pulumi.RegisterInputType(reflect.TypeOf((*PermissionSetMapInput)(nil)).Elem(), PermissionSetMap{})
   342  	pulumi.RegisterOutputType(PermissionSetOutput{})
   343  	pulumi.RegisterOutputType(PermissionSetArrayOutput{})
   344  	pulumi.RegisterOutputType(PermissionSetMapOutput{})
   345  }