github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/datasync/agent.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 datasync
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Manages an AWS DataSync Agent deployed on premises.
    15  //
    16  // > **NOTE:** One of `activationKey` or `ipAddress` must be provided for resource creation (agent activation). Neither is required for resource import. If using `ipAddress`, this provider must be able to make an HTTP (port 80) GET request to the specified IP address from where it is running. The agent will turn off that HTTP server after activation.
    17  //
    18  // ## Example Usage
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/datasync"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			_, err := datasync.NewAgent(ctx, "example", &datasync.AgentArgs{
    34  //				IpAddress: pulumi.String("1.2.3.4"),
    35  //				Name:      pulumi.String("example"),
    36  //			})
    37  //			if err != nil {
    38  //				return err
    39  //			}
    40  //			return nil
    41  //		})
    42  //	}
    43  //
    44  // ```
    45  // <!--End PulumiCodeChooser -->
    46  //
    47  // ## Import
    48  //
    49  // Using `pulumi import`, import `aws_datasync_agent` using the DataSync Agent Amazon Resource Name (ARN). For example:
    50  //
    51  // ```sh
    52  // $ pulumi import aws:datasync/agent:Agent example arn:aws:datasync:us-east-1:123456789012:agent/agent-12345678901234567
    53  // ```
    54  type Agent struct {
    55  	pulumi.CustomResourceState
    56  
    57  	// DataSync Agent activation key during resource creation. Conflicts with `ipAddress`. If an `ipAddress` is provided instead, the provider will retrieve the `activationKey` as part of the resource creation.
    58  	ActivationKey pulumi.StringOutput `pulumi:"activationKey"`
    59  	// Amazon Resource Name (ARN) of the DataSync Agent.
    60  	Arn pulumi.StringOutput `pulumi:"arn"`
    61  	// DataSync Agent IP address to retrieve activation key during resource creation. Conflicts with `activationKey`. DataSync Agent must be accessible on port 80 from where the provider is running.
    62  	IpAddress pulumi.StringOutput `pulumi:"ipAddress"`
    63  	// Name of the DataSync Agent.
    64  	Name pulumi.StringOutput `pulumi:"name"`
    65  	// The IP address of the VPC endpoint the agent should connect to when retrieving an activation key during resource creation. Conflicts with `activationKey`.
    66  	PrivateLinkEndpoint pulumi.StringOutput `pulumi:"privateLinkEndpoint"`
    67  	// The ARNs of the security groups used to protect your data transfer task subnets.
    68  	SecurityGroupArns pulumi.StringArrayOutput `pulumi:"securityGroupArns"`
    69  	// The Amazon Resource Names (ARNs) of the subnets in which DataSync will create elastic network interfaces for each data transfer task.
    70  	SubnetArns pulumi.StringArrayOutput `pulumi:"subnetArns"`
    71  	// Key-value pairs of resource tags to assign to the DataSync Agent. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    72  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    73  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    74  	//
    75  	// Deprecated: Please use `tags` instead.
    76  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    77  	// The ID of the VPC (virtual private cloud) endpoint that the agent has access to.
    78  	VpcEndpointId pulumi.StringPtrOutput `pulumi:"vpcEndpointId"`
    79  }
    80  
    81  // NewAgent registers a new resource with the given unique name, arguments, and options.
    82  func NewAgent(ctx *pulumi.Context,
    83  	name string, args *AgentArgs, opts ...pulumi.ResourceOption) (*Agent, error) {
    84  	if args == nil {
    85  		args = &AgentArgs{}
    86  	}
    87  
    88  	opts = internal.PkgResourceDefaultOpts(opts)
    89  	var resource Agent
    90  	err := ctx.RegisterResource("aws:datasync/agent:Agent", name, args, &resource, opts...)
    91  	if err != nil {
    92  		return nil, err
    93  	}
    94  	return &resource, nil
    95  }
    96  
    97  // GetAgent gets an existing Agent resource's state with the given name, ID, and optional
    98  // state properties that are used to uniquely qualify the lookup (nil if not required).
    99  func GetAgent(ctx *pulumi.Context,
   100  	name string, id pulumi.IDInput, state *AgentState, opts ...pulumi.ResourceOption) (*Agent, error) {
   101  	var resource Agent
   102  	err := ctx.ReadResource("aws:datasync/agent:Agent", name, id, state, &resource, opts...)
   103  	if err != nil {
   104  		return nil, err
   105  	}
   106  	return &resource, nil
   107  }
   108  
   109  // Input properties used for looking up and filtering Agent resources.
   110  type agentState struct {
   111  	// DataSync Agent activation key during resource creation. Conflicts with `ipAddress`. If an `ipAddress` is provided instead, the provider will retrieve the `activationKey` as part of the resource creation.
   112  	ActivationKey *string `pulumi:"activationKey"`
   113  	// Amazon Resource Name (ARN) of the DataSync Agent.
   114  	Arn *string `pulumi:"arn"`
   115  	// DataSync Agent IP address to retrieve activation key during resource creation. Conflicts with `activationKey`. DataSync Agent must be accessible on port 80 from where the provider is running.
   116  	IpAddress *string `pulumi:"ipAddress"`
   117  	// Name of the DataSync Agent.
   118  	Name *string `pulumi:"name"`
   119  	// The IP address of the VPC endpoint the agent should connect to when retrieving an activation key during resource creation. Conflicts with `activationKey`.
   120  	PrivateLinkEndpoint *string `pulumi:"privateLinkEndpoint"`
   121  	// The ARNs of the security groups used to protect your data transfer task subnets.
   122  	SecurityGroupArns []string `pulumi:"securityGroupArns"`
   123  	// The Amazon Resource Names (ARNs) of the subnets in which DataSync will create elastic network interfaces for each data transfer task.
   124  	SubnetArns []string `pulumi:"subnetArns"`
   125  	// Key-value pairs of resource tags to assign to the DataSync Agent. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   126  	Tags map[string]string `pulumi:"tags"`
   127  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   128  	//
   129  	// Deprecated: Please use `tags` instead.
   130  	TagsAll map[string]string `pulumi:"tagsAll"`
   131  	// The ID of the VPC (virtual private cloud) endpoint that the agent has access to.
   132  	VpcEndpointId *string `pulumi:"vpcEndpointId"`
   133  }
   134  
   135  type AgentState struct {
   136  	// DataSync Agent activation key during resource creation. Conflicts with `ipAddress`. If an `ipAddress` is provided instead, the provider will retrieve the `activationKey` as part of the resource creation.
   137  	ActivationKey pulumi.StringPtrInput
   138  	// Amazon Resource Name (ARN) of the DataSync Agent.
   139  	Arn pulumi.StringPtrInput
   140  	// DataSync Agent IP address to retrieve activation key during resource creation. Conflicts with `activationKey`. DataSync Agent must be accessible on port 80 from where the provider is running.
   141  	IpAddress pulumi.StringPtrInput
   142  	// Name of the DataSync Agent.
   143  	Name pulumi.StringPtrInput
   144  	// The IP address of the VPC endpoint the agent should connect to when retrieving an activation key during resource creation. Conflicts with `activationKey`.
   145  	PrivateLinkEndpoint pulumi.StringPtrInput
   146  	// The ARNs of the security groups used to protect your data transfer task subnets.
   147  	SecurityGroupArns pulumi.StringArrayInput
   148  	// The Amazon Resource Names (ARNs) of the subnets in which DataSync will create elastic network interfaces for each data transfer task.
   149  	SubnetArns pulumi.StringArrayInput
   150  	// Key-value pairs of resource tags to assign to the DataSync Agent. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   151  	Tags pulumi.StringMapInput
   152  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   153  	//
   154  	// Deprecated: Please use `tags` instead.
   155  	TagsAll pulumi.StringMapInput
   156  	// The ID of the VPC (virtual private cloud) endpoint that the agent has access to.
   157  	VpcEndpointId pulumi.StringPtrInput
   158  }
   159  
   160  func (AgentState) ElementType() reflect.Type {
   161  	return reflect.TypeOf((*agentState)(nil)).Elem()
   162  }
   163  
   164  type agentArgs struct {
   165  	// DataSync Agent activation key during resource creation. Conflicts with `ipAddress`. If an `ipAddress` is provided instead, the provider will retrieve the `activationKey` as part of the resource creation.
   166  	ActivationKey *string `pulumi:"activationKey"`
   167  	// DataSync Agent IP address to retrieve activation key during resource creation. Conflicts with `activationKey`. DataSync Agent must be accessible on port 80 from where the provider is running.
   168  	IpAddress *string `pulumi:"ipAddress"`
   169  	// Name of the DataSync Agent.
   170  	Name *string `pulumi:"name"`
   171  	// The IP address of the VPC endpoint the agent should connect to when retrieving an activation key during resource creation. Conflicts with `activationKey`.
   172  	PrivateLinkEndpoint *string `pulumi:"privateLinkEndpoint"`
   173  	// The ARNs of the security groups used to protect your data transfer task subnets.
   174  	SecurityGroupArns []string `pulumi:"securityGroupArns"`
   175  	// The Amazon Resource Names (ARNs) of the subnets in which DataSync will create elastic network interfaces for each data transfer task.
   176  	SubnetArns []string `pulumi:"subnetArns"`
   177  	// Key-value pairs of resource tags to assign to the DataSync Agent. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   178  	Tags map[string]string `pulumi:"tags"`
   179  	// The ID of the VPC (virtual private cloud) endpoint that the agent has access to.
   180  	VpcEndpointId *string `pulumi:"vpcEndpointId"`
   181  }
   182  
   183  // The set of arguments for constructing a Agent resource.
   184  type AgentArgs struct {
   185  	// DataSync Agent activation key during resource creation. Conflicts with `ipAddress`. If an `ipAddress` is provided instead, the provider will retrieve the `activationKey` as part of the resource creation.
   186  	ActivationKey pulumi.StringPtrInput
   187  	// DataSync Agent IP address to retrieve activation key during resource creation. Conflicts with `activationKey`. DataSync Agent must be accessible on port 80 from where the provider is running.
   188  	IpAddress pulumi.StringPtrInput
   189  	// Name of the DataSync Agent.
   190  	Name pulumi.StringPtrInput
   191  	// The IP address of the VPC endpoint the agent should connect to when retrieving an activation key during resource creation. Conflicts with `activationKey`.
   192  	PrivateLinkEndpoint pulumi.StringPtrInput
   193  	// The ARNs of the security groups used to protect your data transfer task subnets.
   194  	SecurityGroupArns pulumi.StringArrayInput
   195  	// The Amazon Resource Names (ARNs) of the subnets in which DataSync will create elastic network interfaces for each data transfer task.
   196  	SubnetArns pulumi.StringArrayInput
   197  	// Key-value pairs of resource tags to assign to the DataSync Agent. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   198  	Tags pulumi.StringMapInput
   199  	// The ID of the VPC (virtual private cloud) endpoint that the agent has access to.
   200  	VpcEndpointId pulumi.StringPtrInput
   201  }
   202  
   203  func (AgentArgs) ElementType() reflect.Type {
   204  	return reflect.TypeOf((*agentArgs)(nil)).Elem()
   205  }
   206  
   207  type AgentInput interface {
   208  	pulumi.Input
   209  
   210  	ToAgentOutput() AgentOutput
   211  	ToAgentOutputWithContext(ctx context.Context) AgentOutput
   212  }
   213  
   214  func (*Agent) ElementType() reflect.Type {
   215  	return reflect.TypeOf((**Agent)(nil)).Elem()
   216  }
   217  
   218  func (i *Agent) ToAgentOutput() AgentOutput {
   219  	return i.ToAgentOutputWithContext(context.Background())
   220  }
   221  
   222  func (i *Agent) ToAgentOutputWithContext(ctx context.Context) AgentOutput {
   223  	return pulumi.ToOutputWithContext(ctx, i).(AgentOutput)
   224  }
   225  
   226  // AgentArrayInput is an input type that accepts AgentArray and AgentArrayOutput values.
   227  // You can construct a concrete instance of `AgentArrayInput` via:
   228  //
   229  //	AgentArray{ AgentArgs{...} }
   230  type AgentArrayInput interface {
   231  	pulumi.Input
   232  
   233  	ToAgentArrayOutput() AgentArrayOutput
   234  	ToAgentArrayOutputWithContext(context.Context) AgentArrayOutput
   235  }
   236  
   237  type AgentArray []AgentInput
   238  
   239  func (AgentArray) ElementType() reflect.Type {
   240  	return reflect.TypeOf((*[]*Agent)(nil)).Elem()
   241  }
   242  
   243  func (i AgentArray) ToAgentArrayOutput() AgentArrayOutput {
   244  	return i.ToAgentArrayOutputWithContext(context.Background())
   245  }
   246  
   247  func (i AgentArray) ToAgentArrayOutputWithContext(ctx context.Context) AgentArrayOutput {
   248  	return pulumi.ToOutputWithContext(ctx, i).(AgentArrayOutput)
   249  }
   250  
   251  // AgentMapInput is an input type that accepts AgentMap and AgentMapOutput values.
   252  // You can construct a concrete instance of `AgentMapInput` via:
   253  //
   254  //	AgentMap{ "key": AgentArgs{...} }
   255  type AgentMapInput interface {
   256  	pulumi.Input
   257  
   258  	ToAgentMapOutput() AgentMapOutput
   259  	ToAgentMapOutputWithContext(context.Context) AgentMapOutput
   260  }
   261  
   262  type AgentMap map[string]AgentInput
   263  
   264  func (AgentMap) ElementType() reflect.Type {
   265  	return reflect.TypeOf((*map[string]*Agent)(nil)).Elem()
   266  }
   267  
   268  func (i AgentMap) ToAgentMapOutput() AgentMapOutput {
   269  	return i.ToAgentMapOutputWithContext(context.Background())
   270  }
   271  
   272  func (i AgentMap) ToAgentMapOutputWithContext(ctx context.Context) AgentMapOutput {
   273  	return pulumi.ToOutputWithContext(ctx, i).(AgentMapOutput)
   274  }
   275  
   276  type AgentOutput struct{ *pulumi.OutputState }
   277  
   278  func (AgentOutput) ElementType() reflect.Type {
   279  	return reflect.TypeOf((**Agent)(nil)).Elem()
   280  }
   281  
   282  func (o AgentOutput) ToAgentOutput() AgentOutput {
   283  	return o
   284  }
   285  
   286  func (o AgentOutput) ToAgentOutputWithContext(ctx context.Context) AgentOutput {
   287  	return o
   288  }
   289  
   290  // DataSync Agent activation key during resource creation. Conflicts with `ipAddress`. If an `ipAddress` is provided instead, the provider will retrieve the `activationKey` as part of the resource creation.
   291  func (o AgentOutput) ActivationKey() pulumi.StringOutput {
   292  	return o.ApplyT(func(v *Agent) pulumi.StringOutput { return v.ActivationKey }).(pulumi.StringOutput)
   293  }
   294  
   295  // Amazon Resource Name (ARN) of the DataSync Agent.
   296  func (o AgentOutput) Arn() pulumi.StringOutput {
   297  	return o.ApplyT(func(v *Agent) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   298  }
   299  
   300  // DataSync Agent IP address to retrieve activation key during resource creation. Conflicts with `activationKey`. DataSync Agent must be accessible on port 80 from where the provider is running.
   301  func (o AgentOutput) IpAddress() pulumi.StringOutput {
   302  	return o.ApplyT(func(v *Agent) pulumi.StringOutput { return v.IpAddress }).(pulumi.StringOutput)
   303  }
   304  
   305  // Name of the DataSync Agent.
   306  func (o AgentOutput) Name() pulumi.StringOutput {
   307  	return o.ApplyT(func(v *Agent) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   308  }
   309  
   310  // The IP address of the VPC endpoint the agent should connect to when retrieving an activation key during resource creation. Conflicts with `activationKey`.
   311  func (o AgentOutput) PrivateLinkEndpoint() pulumi.StringOutput {
   312  	return o.ApplyT(func(v *Agent) pulumi.StringOutput { return v.PrivateLinkEndpoint }).(pulumi.StringOutput)
   313  }
   314  
   315  // The ARNs of the security groups used to protect your data transfer task subnets.
   316  func (o AgentOutput) SecurityGroupArns() pulumi.StringArrayOutput {
   317  	return o.ApplyT(func(v *Agent) pulumi.StringArrayOutput { return v.SecurityGroupArns }).(pulumi.StringArrayOutput)
   318  }
   319  
   320  // The Amazon Resource Names (ARNs) of the subnets in which DataSync will create elastic network interfaces for each data transfer task.
   321  func (o AgentOutput) SubnetArns() pulumi.StringArrayOutput {
   322  	return o.ApplyT(func(v *Agent) pulumi.StringArrayOutput { return v.SubnetArns }).(pulumi.StringArrayOutput)
   323  }
   324  
   325  // Key-value pairs of resource tags to assign to the DataSync Agent. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   326  func (o AgentOutput) Tags() pulumi.StringMapOutput {
   327  	return o.ApplyT(func(v *Agent) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   328  }
   329  
   330  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   331  //
   332  // Deprecated: Please use `tags` instead.
   333  func (o AgentOutput) TagsAll() pulumi.StringMapOutput {
   334  	return o.ApplyT(func(v *Agent) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   335  }
   336  
   337  // The ID of the VPC (virtual private cloud) endpoint that the agent has access to.
   338  func (o AgentOutput) VpcEndpointId() pulumi.StringPtrOutput {
   339  	return o.ApplyT(func(v *Agent) pulumi.StringPtrOutput { return v.VpcEndpointId }).(pulumi.StringPtrOutput)
   340  }
   341  
   342  type AgentArrayOutput struct{ *pulumi.OutputState }
   343  
   344  func (AgentArrayOutput) ElementType() reflect.Type {
   345  	return reflect.TypeOf((*[]*Agent)(nil)).Elem()
   346  }
   347  
   348  func (o AgentArrayOutput) ToAgentArrayOutput() AgentArrayOutput {
   349  	return o
   350  }
   351  
   352  func (o AgentArrayOutput) ToAgentArrayOutputWithContext(ctx context.Context) AgentArrayOutput {
   353  	return o
   354  }
   355  
   356  func (o AgentArrayOutput) Index(i pulumi.IntInput) AgentOutput {
   357  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Agent {
   358  		return vs[0].([]*Agent)[vs[1].(int)]
   359  	}).(AgentOutput)
   360  }
   361  
   362  type AgentMapOutput struct{ *pulumi.OutputState }
   363  
   364  func (AgentMapOutput) ElementType() reflect.Type {
   365  	return reflect.TypeOf((*map[string]*Agent)(nil)).Elem()
   366  }
   367  
   368  func (o AgentMapOutput) ToAgentMapOutput() AgentMapOutput {
   369  	return o
   370  }
   371  
   372  func (o AgentMapOutput) ToAgentMapOutputWithContext(ctx context.Context) AgentMapOutput {
   373  	return o
   374  }
   375  
   376  func (o AgentMapOutput) MapIndex(k pulumi.StringInput) AgentOutput {
   377  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Agent {
   378  		return vs[0].(map[string]*Agent)[vs[1].(string)]
   379  	}).(AgentOutput)
   380  }
   381  
   382  func init() {
   383  	pulumi.RegisterInputType(reflect.TypeOf((*AgentInput)(nil)).Elem(), &Agent{})
   384  	pulumi.RegisterInputType(reflect.TypeOf((*AgentArrayInput)(nil)).Elem(), AgentArray{})
   385  	pulumi.RegisterInputType(reflect.TypeOf((*AgentMapInput)(nil)).Elem(), AgentMap{})
   386  	pulumi.RegisterOutputType(AgentOutput{})
   387  	pulumi.RegisterOutputType(AgentArrayOutput{})
   388  	pulumi.RegisterOutputType(AgentMapOutput{})
   389  }