github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/iam/samlProvider.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 iam
     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 an IAM SAML provider.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
    26  //	"github.com/pulumi/pulumi-std/sdk/go/std"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			invokeFile, err := std.File(ctx, &std.FileArgs{
    34  //				Input: "saml-metadata.xml",
    35  //			}, nil)
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			_, err = iam.NewSamlProvider(ctx, "default", &iam.SamlProviderArgs{
    40  //				Name:                 pulumi.String("myprovider"),
    41  //				SamlMetadataDocument: invokeFile.Result,
    42  //			})
    43  //			if err != nil {
    44  //				return err
    45  //			}
    46  //			return nil
    47  //		})
    48  //	}
    49  //
    50  // ```
    51  // <!--End PulumiCodeChooser -->
    52  //
    53  // ## Import
    54  //
    55  // Using `pulumi import`, import IAM SAML Providers using the `arn`. For example:
    56  //
    57  // ```sh
    58  // $ pulumi import aws:iam/samlProvider:SamlProvider default arn:aws:iam::123456789012:saml-provider/SAMLADFS
    59  // ```
    60  type SamlProvider struct {
    61  	pulumi.CustomResourceState
    62  
    63  	// The ARN assigned by AWS for this provider.
    64  	Arn pulumi.StringOutput `pulumi:"arn"`
    65  	// The name of the provider to create.
    66  	Name pulumi.StringOutput `pulumi:"name"`
    67  	// An XML document generated by an identity provider that supports SAML 2.0.
    68  	SamlMetadataDocument pulumi.StringOutput `pulumi:"samlMetadataDocument"`
    69  	// Map of resource tags for the IAM SAML provider. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    70  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    71  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    72  	//
    73  	// Deprecated: Please use `tags` instead.
    74  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    75  	// The expiration date and time for the SAML provider in RFC1123 format, e.g., `Mon, 02 Jan 2006 15:04:05 MST`.
    76  	ValidUntil pulumi.StringOutput `pulumi:"validUntil"`
    77  }
    78  
    79  // NewSamlProvider registers a new resource with the given unique name, arguments, and options.
    80  func NewSamlProvider(ctx *pulumi.Context,
    81  	name string, args *SamlProviderArgs, opts ...pulumi.ResourceOption) (*SamlProvider, error) {
    82  	if args == nil {
    83  		return nil, errors.New("missing one or more required arguments")
    84  	}
    85  
    86  	if args.SamlMetadataDocument == nil {
    87  		return nil, errors.New("invalid value for required argument 'SamlMetadataDocument'")
    88  	}
    89  	opts = internal.PkgResourceDefaultOpts(opts)
    90  	var resource SamlProvider
    91  	err := ctx.RegisterResource("aws:iam/samlProvider:SamlProvider", name, args, &resource, opts...)
    92  	if err != nil {
    93  		return nil, err
    94  	}
    95  	return &resource, nil
    96  }
    97  
    98  // GetSamlProvider gets an existing SamlProvider resource's state with the given name, ID, and optional
    99  // state properties that are used to uniquely qualify the lookup (nil if not required).
   100  func GetSamlProvider(ctx *pulumi.Context,
   101  	name string, id pulumi.IDInput, state *SamlProviderState, opts ...pulumi.ResourceOption) (*SamlProvider, error) {
   102  	var resource SamlProvider
   103  	err := ctx.ReadResource("aws:iam/samlProvider:SamlProvider", name, id, state, &resource, opts...)
   104  	if err != nil {
   105  		return nil, err
   106  	}
   107  	return &resource, nil
   108  }
   109  
   110  // Input properties used for looking up and filtering SamlProvider resources.
   111  type samlProviderState struct {
   112  	// The ARN assigned by AWS for this provider.
   113  	Arn *string `pulumi:"arn"`
   114  	// The name of the provider to create.
   115  	Name *string `pulumi:"name"`
   116  	// An XML document generated by an identity provider that supports SAML 2.0.
   117  	SamlMetadataDocument *string `pulumi:"samlMetadataDocument"`
   118  	// Map of resource tags for the IAM SAML provider. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   119  	Tags map[string]string `pulumi:"tags"`
   120  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   121  	//
   122  	// Deprecated: Please use `tags` instead.
   123  	TagsAll map[string]string `pulumi:"tagsAll"`
   124  	// The expiration date and time for the SAML provider in RFC1123 format, e.g., `Mon, 02 Jan 2006 15:04:05 MST`.
   125  	ValidUntil *string `pulumi:"validUntil"`
   126  }
   127  
   128  type SamlProviderState struct {
   129  	// The ARN assigned by AWS for this provider.
   130  	Arn pulumi.StringPtrInput
   131  	// The name of the provider to create.
   132  	Name pulumi.StringPtrInput
   133  	// An XML document generated by an identity provider that supports SAML 2.0.
   134  	SamlMetadataDocument pulumi.StringPtrInput
   135  	// Map of resource tags for the IAM SAML provider. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   136  	Tags pulumi.StringMapInput
   137  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   138  	//
   139  	// Deprecated: Please use `tags` instead.
   140  	TagsAll pulumi.StringMapInput
   141  	// The expiration date and time for the SAML provider in RFC1123 format, e.g., `Mon, 02 Jan 2006 15:04:05 MST`.
   142  	ValidUntil pulumi.StringPtrInput
   143  }
   144  
   145  func (SamlProviderState) ElementType() reflect.Type {
   146  	return reflect.TypeOf((*samlProviderState)(nil)).Elem()
   147  }
   148  
   149  type samlProviderArgs struct {
   150  	// The name of the provider to create.
   151  	Name *string `pulumi:"name"`
   152  	// An XML document generated by an identity provider that supports SAML 2.0.
   153  	SamlMetadataDocument string `pulumi:"samlMetadataDocument"`
   154  	// Map of resource tags for the IAM SAML provider. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   155  	Tags map[string]string `pulumi:"tags"`
   156  }
   157  
   158  // The set of arguments for constructing a SamlProvider resource.
   159  type SamlProviderArgs struct {
   160  	// The name of the provider to create.
   161  	Name pulumi.StringPtrInput
   162  	// An XML document generated by an identity provider that supports SAML 2.0.
   163  	SamlMetadataDocument pulumi.StringInput
   164  	// Map of resource tags for the IAM SAML provider. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   165  	Tags pulumi.StringMapInput
   166  }
   167  
   168  func (SamlProviderArgs) ElementType() reflect.Type {
   169  	return reflect.TypeOf((*samlProviderArgs)(nil)).Elem()
   170  }
   171  
   172  type SamlProviderInput interface {
   173  	pulumi.Input
   174  
   175  	ToSamlProviderOutput() SamlProviderOutput
   176  	ToSamlProviderOutputWithContext(ctx context.Context) SamlProviderOutput
   177  }
   178  
   179  func (*SamlProvider) ElementType() reflect.Type {
   180  	return reflect.TypeOf((**SamlProvider)(nil)).Elem()
   181  }
   182  
   183  func (i *SamlProvider) ToSamlProviderOutput() SamlProviderOutput {
   184  	return i.ToSamlProviderOutputWithContext(context.Background())
   185  }
   186  
   187  func (i *SamlProvider) ToSamlProviderOutputWithContext(ctx context.Context) SamlProviderOutput {
   188  	return pulumi.ToOutputWithContext(ctx, i).(SamlProviderOutput)
   189  }
   190  
   191  // SamlProviderArrayInput is an input type that accepts SamlProviderArray and SamlProviderArrayOutput values.
   192  // You can construct a concrete instance of `SamlProviderArrayInput` via:
   193  //
   194  //	SamlProviderArray{ SamlProviderArgs{...} }
   195  type SamlProviderArrayInput interface {
   196  	pulumi.Input
   197  
   198  	ToSamlProviderArrayOutput() SamlProviderArrayOutput
   199  	ToSamlProviderArrayOutputWithContext(context.Context) SamlProviderArrayOutput
   200  }
   201  
   202  type SamlProviderArray []SamlProviderInput
   203  
   204  func (SamlProviderArray) ElementType() reflect.Type {
   205  	return reflect.TypeOf((*[]*SamlProvider)(nil)).Elem()
   206  }
   207  
   208  func (i SamlProviderArray) ToSamlProviderArrayOutput() SamlProviderArrayOutput {
   209  	return i.ToSamlProviderArrayOutputWithContext(context.Background())
   210  }
   211  
   212  func (i SamlProviderArray) ToSamlProviderArrayOutputWithContext(ctx context.Context) SamlProviderArrayOutput {
   213  	return pulumi.ToOutputWithContext(ctx, i).(SamlProviderArrayOutput)
   214  }
   215  
   216  // SamlProviderMapInput is an input type that accepts SamlProviderMap and SamlProviderMapOutput values.
   217  // You can construct a concrete instance of `SamlProviderMapInput` via:
   218  //
   219  //	SamlProviderMap{ "key": SamlProviderArgs{...} }
   220  type SamlProviderMapInput interface {
   221  	pulumi.Input
   222  
   223  	ToSamlProviderMapOutput() SamlProviderMapOutput
   224  	ToSamlProviderMapOutputWithContext(context.Context) SamlProviderMapOutput
   225  }
   226  
   227  type SamlProviderMap map[string]SamlProviderInput
   228  
   229  func (SamlProviderMap) ElementType() reflect.Type {
   230  	return reflect.TypeOf((*map[string]*SamlProvider)(nil)).Elem()
   231  }
   232  
   233  func (i SamlProviderMap) ToSamlProviderMapOutput() SamlProviderMapOutput {
   234  	return i.ToSamlProviderMapOutputWithContext(context.Background())
   235  }
   236  
   237  func (i SamlProviderMap) ToSamlProviderMapOutputWithContext(ctx context.Context) SamlProviderMapOutput {
   238  	return pulumi.ToOutputWithContext(ctx, i).(SamlProviderMapOutput)
   239  }
   240  
   241  type SamlProviderOutput struct{ *pulumi.OutputState }
   242  
   243  func (SamlProviderOutput) ElementType() reflect.Type {
   244  	return reflect.TypeOf((**SamlProvider)(nil)).Elem()
   245  }
   246  
   247  func (o SamlProviderOutput) ToSamlProviderOutput() SamlProviderOutput {
   248  	return o
   249  }
   250  
   251  func (o SamlProviderOutput) ToSamlProviderOutputWithContext(ctx context.Context) SamlProviderOutput {
   252  	return o
   253  }
   254  
   255  // The ARN assigned by AWS for this provider.
   256  func (o SamlProviderOutput) Arn() pulumi.StringOutput {
   257  	return o.ApplyT(func(v *SamlProvider) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   258  }
   259  
   260  // The name of the provider to create.
   261  func (o SamlProviderOutput) Name() pulumi.StringOutput {
   262  	return o.ApplyT(func(v *SamlProvider) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   263  }
   264  
   265  // An XML document generated by an identity provider that supports SAML 2.0.
   266  func (o SamlProviderOutput) SamlMetadataDocument() pulumi.StringOutput {
   267  	return o.ApplyT(func(v *SamlProvider) pulumi.StringOutput { return v.SamlMetadataDocument }).(pulumi.StringOutput)
   268  }
   269  
   270  // Map of resource tags for the IAM SAML provider. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   271  func (o SamlProviderOutput) Tags() pulumi.StringMapOutput {
   272  	return o.ApplyT(func(v *SamlProvider) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   273  }
   274  
   275  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   276  //
   277  // Deprecated: Please use `tags` instead.
   278  func (o SamlProviderOutput) TagsAll() pulumi.StringMapOutput {
   279  	return o.ApplyT(func(v *SamlProvider) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   280  }
   281  
   282  // The expiration date and time for the SAML provider in RFC1123 format, e.g., `Mon, 02 Jan 2006 15:04:05 MST`.
   283  func (o SamlProviderOutput) ValidUntil() pulumi.StringOutput {
   284  	return o.ApplyT(func(v *SamlProvider) pulumi.StringOutput { return v.ValidUntil }).(pulumi.StringOutput)
   285  }
   286  
   287  type SamlProviderArrayOutput struct{ *pulumi.OutputState }
   288  
   289  func (SamlProviderArrayOutput) ElementType() reflect.Type {
   290  	return reflect.TypeOf((*[]*SamlProvider)(nil)).Elem()
   291  }
   292  
   293  func (o SamlProviderArrayOutput) ToSamlProviderArrayOutput() SamlProviderArrayOutput {
   294  	return o
   295  }
   296  
   297  func (o SamlProviderArrayOutput) ToSamlProviderArrayOutputWithContext(ctx context.Context) SamlProviderArrayOutput {
   298  	return o
   299  }
   300  
   301  func (o SamlProviderArrayOutput) Index(i pulumi.IntInput) SamlProviderOutput {
   302  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SamlProvider {
   303  		return vs[0].([]*SamlProvider)[vs[1].(int)]
   304  	}).(SamlProviderOutput)
   305  }
   306  
   307  type SamlProviderMapOutput struct{ *pulumi.OutputState }
   308  
   309  func (SamlProviderMapOutput) ElementType() reflect.Type {
   310  	return reflect.TypeOf((*map[string]*SamlProvider)(nil)).Elem()
   311  }
   312  
   313  func (o SamlProviderMapOutput) ToSamlProviderMapOutput() SamlProviderMapOutput {
   314  	return o
   315  }
   316  
   317  func (o SamlProviderMapOutput) ToSamlProviderMapOutputWithContext(ctx context.Context) SamlProviderMapOutput {
   318  	return o
   319  }
   320  
   321  func (o SamlProviderMapOutput) MapIndex(k pulumi.StringInput) SamlProviderOutput {
   322  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SamlProvider {
   323  		return vs[0].(map[string]*SamlProvider)[vs[1].(string)]
   324  	}).(SamlProviderOutput)
   325  }
   326  
   327  func init() {
   328  	pulumi.RegisterInputType(reflect.TypeOf((*SamlProviderInput)(nil)).Elem(), &SamlProvider{})
   329  	pulumi.RegisterInputType(reflect.TypeOf((*SamlProviderArrayInput)(nil)).Elem(), SamlProviderArray{})
   330  	pulumi.RegisterInputType(reflect.TypeOf((*SamlProviderMapInput)(nil)).Elem(), SamlProviderMap{})
   331  	pulumi.RegisterOutputType(SamlProviderOutput{})
   332  	pulumi.RegisterOutputType(SamlProviderArrayOutput{})
   333  	pulumi.RegisterOutputType(SamlProviderMapOutput{})
   334  }