github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/verifiedaccess/instanceTrustProviderAttachment.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 verifiedaccess
     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  // Resource for managing a Verified Access Instance Trust Provider Attachment.
    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/verifiedaccess"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			example, err := verifiedaccess.NewInstance(ctx, "example", nil)
    33  //			if err != nil {
    34  //				return err
    35  //			}
    36  //			exampleTrustProvider, err := verifiedaccess.NewTrustProvider(ctx, "example", &verifiedaccess.TrustProviderArgs{
    37  //				DeviceTrustProviderType: pulumi.String("jamf"),
    38  //				PolicyReferenceName:     pulumi.String("example"),
    39  //				TrustProviderType:       pulumi.String("device"),
    40  //				DeviceOptions: &verifiedaccess.TrustProviderDeviceOptionsArgs{
    41  //					TenantId: pulumi.String("example"),
    42  //				},
    43  //			})
    44  //			if err != nil {
    45  //				return err
    46  //			}
    47  //			_, err = verifiedaccess.NewInstanceTrustProviderAttachment(ctx, "example", &verifiedaccess.InstanceTrustProviderAttachmentArgs{
    48  //				VerifiedaccessInstanceId:      example.ID(),
    49  //				VerifiedaccessTrustProviderId: exampleTrustProvider.ID(),
    50  //			})
    51  //			if err != nil {
    52  //				return err
    53  //			}
    54  //			return nil
    55  //		})
    56  //	}
    57  //
    58  // ```
    59  // <!--End PulumiCodeChooser -->
    60  //
    61  // ## Import
    62  //
    63  // Using `pulumi import`, import Verified Access Instance Trust Provider Attachments using the `verifiedaccess_instance_id` and `verifiedaccess_trust_provider_id` separated by a forward slash (`/`). For example:
    64  //
    65  // ```sh
    66  // $ pulumi import aws:verifiedaccess/instanceTrustProviderAttachment:InstanceTrustProviderAttachment example vai-1234567890abcdef0/vatp-8012925589
    67  // ```
    68  type InstanceTrustProviderAttachment struct {
    69  	pulumi.CustomResourceState
    70  
    71  	// The ID of the Verified Access instance to attach the Trust Provider to.
    72  	VerifiedaccessInstanceId pulumi.StringOutput `pulumi:"verifiedaccessInstanceId"`
    73  	// The ID of the Verified Access trust provider.
    74  	VerifiedaccessTrustProviderId pulumi.StringOutput `pulumi:"verifiedaccessTrustProviderId"`
    75  }
    76  
    77  // NewInstanceTrustProviderAttachment registers a new resource with the given unique name, arguments, and options.
    78  func NewInstanceTrustProviderAttachment(ctx *pulumi.Context,
    79  	name string, args *InstanceTrustProviderAttachmentArgs, opts ...pulumi.ResourceOption) (*InstanceTrustProviderAttachment, error) {
    80  	if args == nil {
    81  		return nil, errors.New("missing one or more required arguments")
    82  	}
    83  
    84  	if args.VerifiedaccessInstanceId == nil {
    85  		return nil, errors.New("invalid value for required argument 'VerifiedaccessInstanceId'")
    86  	}
    87  	if args.VerifiedaccessTrustProviderId == nil {
    88  		return nil, errors.New("invalid value for required argument 'VerifiedaccessTrustProviderId'")
    89  	}
    90  	opts = internal.PkgResourceDefaultOpts(opts)
    91  	var resource InstanceTrustProviderAttachment
    92  	err := ctx.RegisterResource("aws:verifiedaccess/instanceTrustProviderAttachment:InstanceTrustProviderAttachment", name, args, &resource, opts...)
    93  	if err != nil {
    94  		return nil, err
    95  	}
    96  	return &resource, nil
    97  }
    98  
    99  // GetInstanceTrustProviderAttachment gets an existing InstanceTrustProviderAttachment resource's state with the given name, ID, and optional
   100  // state properties that are used to uniquely qualify the lookup (nil if not required).
   101  func GetInstanceTrustProviderAttachment(ctx *pulumi.Context,
   102  	name string, id pulumi.IDInput, state *InstanceTrustProviderAttachmentState, opts ...pulumi.ResourceOption) (*InstanceTrustProviderAttachment, error) {
   103  	var resource InstanceTrustProviderAttachment
   104  	err := ctx.ReadResource("aws:verifiedaccess/instanceTrustProviderAttachment:InstanceTrustProviderAttachment", name, id, state, &resource, opts...)
   105  	if err != nil {
   106  		return nil, err
   107  	}
   108  	return &resource, nil
   109  }
   110  
   111  // Input properties used for looking up and filtering InstanceTrustProviderAttachment resources.
   112  type instanceTrustProviderAttachmentState struct {
   113  	// The ID of the Verified Access instance to attach the Trust Provider to.
   114  	VerifiedaccessInstanceId *string `pulumi:"verifiedaccessInstanceId"`
   115  	// The ID of the Verified Access trust provider.
   116  	VerifiedaccessTrustProviderId *string `pulumi:"verifiedaccessTrustProviderId"`
   117  }
   118  
   119  type InstanceTrustProviderAttachmentState struct {
   120  	// The ID of the Verified Access instance to attach the Trust Provider to.
   121  	VerifiedaccessInstanceId pulumi.StringPtrInput
   122  	// The ID of the Verified Access trust provider.
   123  	VerifiedaccessTrustProviderId pulumi.StringPtrInput
   124  }
   125  
   126  func (InstanceTrustProviderAttachmentState) ElementType() reflect.Type {
   127  	return reflect.TypeOf((*instanceTrustProviderAttachmentState)(nil)).Elem()
   128  }
   129  
   130  type instanceTrustProviderAttachmentArgs struct {
   131  	// The ID of the Verified Access instance to attach the Trust Provider to.
   132  	VerifiedaccessInstanceId string `pulumi:"verifiedaccessInstanceId"`
   133  	// The ID of the Verified Access trust provider.
   134  	VerifiedaccessTrustProviderId string `pulumi:"verifiedaccessTrustProviderId"`
   135  }
   136  
   137  // The set of arguments for constructing a InstanceTrustProviderAttachment resource.
   138  type InstanceTrustProviderAttachmentArgs struct {
   139  	// The ID of the Verified Access instance to attach the Trust Provider to.
   140  	VerifiedaccessInstanceId pulumi.StringInput
   141  	// The ID of the Verified Access trust provider.
   142  	VerifiedaccessTrustProviderId pulumi.StringInput
   143  }
   144  
   145  func (InstanceTrustProviderAttachmentArgs) ElementType() reflect.Type {
   146  	return reflect.TypeOf((*instanceTrustProviderAttachmentArgs)(nil)).Elem()
   147  }
   148  
   149  type InstanceTrustProviderAttachmentInput interface {
   150  	pulumi.Input
   151  
   152  	ToInstanceTrustProviderAttachmentOutput() InstanceTrustProviderAttachmentOutput
   153  	ToInstanceTrustProviderAttachmentOutputWithContext(ctx context.Context) InstanceTrustProviderAttachmentOutput
   154  }
   155  
   156  func (*InstanceTrustProviderAttachment) ElementType() reflect.Type {
   157  	return reflect.TypeOf((**InstanceTrustProviderAttachment)(nil)).Elem()
   158  }
   159  
   160  func (i *InstanceTrustProviderAttachment) ToInstanceTrustProviderAttachmentOutput() InstanceTrustProviderAttachmentOutput {
   161  	return i.ToInstanceTrustProviderAttachmentOutputWithContext(context.Background())
   162  }
   163  
   164  func (i *InstanceTrustProviderAttachment) ToInstanceTrustProviderAttachmentOutputWithContext(ctx context.Context) InstanceTrustProviderAttachmentOutput {
   165  	return pulumi.ToOutputWithContext(ctx, i).(InstanceTrustProviderAttachmentOutput)
   166  }
   167  
   168  // InstanceTrustProviderAttachmentArrayInput is an input type that accepts InstanceTrustProviderAttachmentArray and InstanceTrustProviderAttachmentArrayOutput values.
   169  // You can construct a concrete instance of `InstanceTrustProviderAttachmentArrayInput` via:
   170  //
   171  //	InstanceTrustProviderAttachmentArray{ InstanceTrustProviderAttachmentArgs{...} }
   172  type InstanceTrustProviderAttachmentArrayInput interface {
   173  	pulumi.Input
   174  
   175  	ToInstanceTrustProviderAttachmentArrayOutput() InstanceTrustProviderAttachmentArrayOutput
   176  	ToInstanceTrustProviderAttachmentArrayOutputWithContext(context.Context) InstanceTrustProviderAttachmentArrayOutput
   177  }
   178  
   179  type InstanceTrustProviderAttachmentArray []InstanceTrustProviderAttachmentInput
   180  
   181  func (InstanceTrustProviderAttachmentArray) ElementType() reflect.Type {
   182  	return reflect.TypeOf((*[]*InstanceTrustProviderAttachment)(nil)).Elem()
   183  }
   184  
   185  func (i InstanceTrustProviderAttachmentArray) ToInstanceTrustProviderAttachmentArrayOutput() InstanceTrustProviderAttachmentArrayOutput {
   186  	return i.ToInstanceTrustProviderAttachmentArrayOutputWithContext(context.Background())
   187  }
   188  
   189  func (i InstanceTrustProviderAttachmentArray) ToInstanceTrustProviderAttachmentArrayOutputWithContext(ctx context.Context) InstanceTrustProviderAttachmentArrayOutput {
   190  	return pulumi.ToOutputWithContext(ctx, i).(InstanceTrustProviderAttachmentArrayOutput)
   191  }
   192  
   193  // InstanceTrustProviderAttachmentMapInput is an input type that accepts InstanceTrustProviderAttachmentMap and InstanceTrustProviderAttachmentMapOutput values.
   194  // You can construct a concrete instance of `InstanceTrustProviderAttachmentMapInput` via:
   195  //
   196  //	InstanceTrustProviderAttachmentMap{ "key": InstanceTrustProviderAttachmentArgs{...} }
   197  type InstanceTrustProviderAttachmentMapInput interface {
   198  	pulumi.Input
   199  
   200  	ToInstanceTrustProviderAttachmentMapOutput() InstanceTrustProviderAttachmentMapOutput
   201  	ToInstanceTrustProviderAttachmentMapOutputWithContext(context.Context) InstanceTrustProviderAttachmentMapOutput
   202  }
   203  
   204  type InstanceTrustProviderAttachmentMap map[string]InstanceTrustProviderAttachmentInput
   205  
   206  func (InstanceTrustProviderAttachmentMap) ElementType() reflect.Type {
   207  	return reflect.TypeOf((*map[string]*InstanceTrustProviderAttachment)(nil)).Elem()
   208  }
   209  
   210  func (i InstanceTrustProviderAttachmentMap) ToInstanceTrustProviderAttachmentMapOutput() InstanceTrustProviderAttachmentMapOutput {
   211  	return i.ToInstanceTrustProviderAttachmentMapOutputWithContext(context.Background())
   212  }
   213  
   214  func (i InstanceTrustProviderAttachmentMap) ToInstanceTrustProviderAttachmentMapOutputWithContext(ctx context.Context) InstanceTrustProviderAttachmentMapOutput {
   215  	return pulumi.ToOutputWithContext(ctx, i).(InstanceTrustProviderAttachmentMapOutput)
   216  }
   217  
   218  type InstanceTrustProviderAttachmentOutput struct{ *pulumi.OutputState }
   219  
   220  func (InstanceTrustProviderAttachmentOutput) ElementType() reflect.Type {
   221  	return reflect.TypeOf((**InstanceTrustProviderAttachment)(nil)).Elem()
   222  }
   223  
   224  func (o InstanceTrustProviderAttachmentOutput) ToInstanceTrustProviderAttachmentOutput() InstanceTrustProviderAttachmentOutput {
   225  	return o
   226  }
   227  
   228  func (o InstanceTrustProviderAttachmentOutput) ToInstanceTrustProviderAttachmentOutputWithContext(ctx context.Context) InstanceTrustProviderAttachmentOutput {
   229  	return o
   230  }
   231  
   232  // The ID of the Verified Access instance to attach the Trust Provider to.
   233  func (o InstanceTrustProviderAttachmentOutput) VerifiedaccessInstanceId() pulumi.StringOutput {
   234  	return o.ApplyT(func(v *InstanceTrustProviderAttachment) pulumi.StringOutput { return v.VerifiedaccessInstanceId }).(pulumi.StringOutput)
   235  }
   236  
   237  // The ID of the Verified Access trust provider.
   238  func (o InstanceTrustProviderAttachmentOutput) VerifiedaccessTrustProviderId() pulumi.StringOutput {
   239  	return o.ApplyT(func(v *InstanceTrustProviderAttachment) pulumi.StringOutput { return v.VerifiedaccessTrustProviderId }).(pulumi.StringOutput)
   240  }
   241  
   242  type InstanceTrustProviderAttachmentArrayOutput struct{ *pulumi.OutputState }
   243  
   244  func (InstanceTrustProviderAttachmentArrayOutput) ElementType() reflect.Type {
   245  	return reflect.TypeOf((*[]*InstanceTrustProviderAttachment)(nil)).Elem()
   246  }
   247  
   248  func (o InstanceTrustProviderAttachmentArrayOutput) ToInstanceTrustProviderAttachmentArrayOutput() InstanceTrustProviderAttachmentArrayOutput {
   249  	return o
   250  }
   251  
   252  func (o InstanceTrustProviderAttachmentArrayOutput) ToInstanceTrustProviderAttachmentArrayOutputWithContext(ctx context.Context) InstanceTrustProviderAttachmentArrayOutput {
   253  	return o
   254  }
   255  
   256  func (o InstanceTrustProviderAttachmentArrayOutput) Index(i pulumi.IntInput) InstanceTrustProviderAttachmentOutput {
   257  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *InstanceTrustProviderAttachment {
   258  		return vs[0].([]*InstanceTrustProviderAttachment)[vs[1].(int)]
   259  	}).(InstanceTrustProviderAttachmentOutput)
   260  }
   261  
   262  type InstanceTrustProviderAttachmentMapOutput struct{ *pulumi.OutputState }
   263  
   264  func (InstanceTrustProviderAttachmentMapOutput) ElementType() reflect.Type {
   265  	return reflect.TypeOf((*map[string]*InstanceTrustProviderAttachment)(nil)).Elem()
   266  }
   267  
   268  func (o InstanceTrustProviderAttachmentMapOutput) ToInstanceTrustProviderAttachmentMapOutput() InstanceTrustProviderAttachmentMapOutput {
   269  	return o
   270  }
   271  
   272  func (o InstanceTrustProviderAttachmentMapOutput) ToInstanceTrustProviderAttachmentMapOutputWithContext(ctx context.Context) InstanceTrustProviderAttachmentMapOutput {
   273  	return o
   274  }
   275  
   276  func (o InstanceTrustProviderAttachmentMapOutput) MapIndex(k pulumi.StringInput) InstanceTrustProviderAttachmentOutput {
   277  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *InstanceTrustProviderAttachment {
   278  		return vs[0].(map[string]*InstanceTrustProviderAttachment)[vs[1].(string)]
   279  	}).(InstanceTrustProviderAttachmentOutput)
   280  }
   281  
   282  func init() {
   283  	pulumi.RegisterInputType(reflect.TypeOf((*InstanceTrustProviderAttachmentInput)(nil)).Elem(), &InstanceTrustProviderAttachment{})
   284  	pulumi.RegisterInputType(reflect.TypeOf((*InstanceTrustProviderAttachmentArrayInput)(nil)).Elem(), InstanceTrustProviderAttachmentArray{})
   285  	pulumi.RegisterInputType(reflect.TypeOf((*InstanceTrustProviderAttachmentMapInput)(nil)).Elem(), InstanceTrustProviderAttachmentMap{})
   286  	pulumi.RegisterOutputType(InstanceTrustProviderAttachmentOutput{})
   287  	pulumi.RegisterOutputType(InstanceTrustProviderAttachmentArrayOutput{})
   288  	pulumi.RegisterOutputType(InstanceTrustProviderAttachmentMapOutput{})
   289  }