github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/kinesisanalyticsv2/applicationSnapshot.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 kinesisanalyticsv2
     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  // Manages a Kinesis Analytics v2 Application Snapshot.
    16  // Snapshots are the AWS implementation of [Flink Savepoints](https://ci.apache.org/projects/flink/flink-docs-release-1.11/ops/state/savepoints.html).
    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/kinesisanalyticsv2"
    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 := kinesisanalyticsv2.NewApplicationSnapshot(ctx, "example", &kinesisanalyticsv2.ApplicationSnapshotArgs{
    34  //				ApplicationName: pulumi.Any(exampleAwsKinesisanalyticsv2Application.Name),
    35  //				SnapshotName:    pulumi.String("example-snapshot"),
    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_kinesisanalyticsv2_application` using `application_name` together with `snapshot_name`. For example:
    50  //
    51  // ```sh
    52  // $ pulumi import aws:kinesisanalyticsv2/applicationSnapshot:ApplicationSnapshot example example-application/example-snapshot
    53  // ```
    54  type ApplicationSnapshot struct {
    55  	pulumi.CustomResourceState
    56  
    57  	// The name of an existing  Kinesis Analytics v2 Application. Note that the application must be running for a snapshot to be created.
    58  	ApplicationName pulumi.StringOutput `pulumi:"applicationName"`
    59  	// The current application version ID when the snapshot was created.
    60  	ApplicationVersionId pulumi.IntOutput `pulumi:"applicationVersionId"`
    61  	// The timestamp of the application snapshot.
    62  	SnapshotCreationTimestamp pulumi.StringOutput `pulumi:"snapshotCreationTimestamp"`
    63  	// The name of the application snapshot.
    64  	SnapshotName pulumi.StringOutput `pulumi:"snapshotName"`
    65  }
    66  
    67  // NewApplicationSnapshot registers a new resource with the given unique name, arguments, and options.
    68  func NewApplicationSnapshot(ctx *pulumi.Context,
    69  	name string, args *ApplicationSnapshotArgs, opts ...pulumi.ResourceOption) (*ApplicationSnapshot, error) {
    70  	if args == nil {
    71  		return nil, errors.New("missing one or more required arguments")
    72  	}
    73  
    74  	if args.ApplicationName == nil {
    75  		return nil, errors.New("invalid value for required argument 'ApplicationName'")
    76  	}
    77  	if args.SnapshotName == nil {
    78  		return nil, errors.New("invalid value for required argument 'SnapshotName'")
    79  	}
    80  	opts = internal.PkgResourceDefaultOpts(opts)
    81  	var resource ApplicationSnapshot
    82  	err := ctx.RegisterResource("aws:kinesisanalyticsv2/applicationSnapshot:ApplicationSnapshot", name, args, &resource, opts...)
    83  	if err != nil {
    84  		return nil, err
    85  	}
    86  	return &resource, nil
    87  }
    88  
    89  // GetApplicationSnapshot gets an existing ApplicationSnapshot resource's state with the given name, ID, and optional
    90  // state properties that are used to uniquely qualify the lookup (nil if not required).
    91  func GetApplicationSnapshot(ctx *pulumi.Context,
    92  	name string, id pulumi.IDInput, state *ApplicationSnapshotState, opts ...pulumi.ResourceOption) (*ApplicationSnapshot, error) {
    93  	var resource ApplicationSnapshot
    94  	err := ctx.ReadResource("aws:kinesisanalyticsv2/applicationSnapshot:ApplicationSnapshot", name, id, state, &resource, opts...)
    95  	if err != nil {
    96  		return nil, err
    97  	}
    98  	return &resource, nil
    99  }
   100  
   101  // Input properties used for looking up and filtering ApplicationSnapshot resources.
   102  type applicationSnapshotState struct {
   103  	// The name of an existing  Kinesis Analytics v2 Application. Note that the application must be running for a snapshot to be created.
   104  	ApplicationName *string `pulumi:"applicationName"`
   105  	// The current application version ID when the snapshot was created.
   106  	ApplicationVersionId *int `pulumi:"applicationVersionId"`
   107  	// The timestamp of the application snapshot.
   108  	SnapshotCreationTimestamp *string `pulumi:"snapshotCreationTimestamp"`
   109  	// The name of the application snapshot.
   110  	SnapshotName *string `pulumi:"snapshotName"`
   111  }
   112  
   113  type ApplicationSnapshotState struct {
   114  	// The name of an existing  Kinesis Analytics v2 Application. Note that the application must be running for a snapshot to be created.
   115  	ApplicationName pulumi.StringPtrInput
   116  	// The current application version ID when the snapshot was created.
   117  	ApplicationVersionId pulumi.IntPtrInput
   118  	// The timestamp of the application snapshot.
   119  	SnapshotCreationTimestamp pulumi.StringPtrInput
   120  	// The name of the application snapshot.
   121  	SnapshotName pulumi.StringPtrInput
   122  }
   123  
   124  func (ApplicationSnapshotState) ElementType() reflect.Type {
   125  	return reflect.TypeOf((*applicationSnapshotState)(nil)).Elem()
   126  }
   127  
   128  type applicationSnapshotArgs struct {
   129  	// The name of an existing  Kinesis Analytics v2 Application. Note that the application must be running for a snapshot to be created.
   130  	ApplicationName string `pulumi:"applicationName"`
   131  	// The name of the application snapshot.
   132  	SnapshotName string `pulumi:"snapshotName"`
   133  }
   134  
   135  // The set of arguments for constructing a ApplicationSnapshot resource.
   136  type ApplicationSnapshotArgs struct {
   137  	// The name of an existing  Kinesis Analytics v2 Application. Note that the application must be running for a snapshot to be created.
   138  	ApplicationName pulumi.StringInput
   139  	// The name of the application snapshot.
   140  	SnapshotName pulumi.StringInput
   141  }
   142  
   143  func (ApplicationSnapshotArgs) ElementType() reflect.Type {
   144  	return reflect.TypeOf((*applicationSnapshotArgs)(nil)).Elem()
   145  }
   146  
   147  type ApplicationSnapshotInput interface {
   148  	pulumi.Input
   149  
   150  	ToApplicationSnapshotOutput() ApplicationSnapshotOutput
   151  	ToApplicationSnapshotOutputWithContext(ctx context.Context) ApplicationSnapshotOutput
   152  }
   153  
   154  func (*ApplicationSnapshot) ElementType() reflect.Type {
   155  	return reflect.TypeOf((**ApplicationSnapshot)(nil)).Elem()
   156  }
   157  
   158  func (i *ApplicationSnapshot) ToApplicationSnapshotOutput() ApplicationSnapshotOutput {
   159  	return i.ToApplicationSnapshotOutputWithContext(context.Background())
   160  }
   161  
   162  func (i *ApplicationSnapshot) ToApplicationSnapshotOutputWithContext(ctx context.Context) ApplicationSnapshotOutput {
   163  	return pulumi.ToOutputWithContext(ctx, i).(ApplicationSnapshotOutput)
   164  }
   165  
   166  // ApplicationSnapshotArrayInput is an input type that accepts ApplicationSnapshotArray and ApplicationSnapshotArrayOutput values.
   167  // You can construct a concrete instance of `ApplicationSnapshotArrayInput` via:
   168  //
   169  //	ApplicationSnapshotArray{ ApplicationSnapshotArgs{...} }
   170  type ApplicationSnapshotArrayInput interface {
   171  	pulumi.Input
   172  
   173  	ToApplicationSnapshotArrayOutput() ApplicationSnapshotArrayOutput
   174  	ToApplicationSnapshotArrayOutputWithContext(context.Context) ApplicationSnapshotArrayOutput
   175  }
   176  
   177  type ApplicationSnapshotArray []ApplicationSnapshotInput
   178  
   179  func (ApplicationSnapshotArray) ElementType() reflect.Type {
   180  	return reflect.TypeOf((*[]*ApplicationSnapshot)(nil)).Elem()
   181  }
   182  
   183  func (i ApplicationSnapshotArray) ToApplicationSnapshotArrayOutput() ApplicationSnapshotArrayOutput {
   184  	return i.ToApplicationSnapshotArrayOutputWithContext(context.Background())
   185  }
   186  
   187  func (i ApplicationSnapshotArray) ToApplicationSnapshotArrayOutputWithContext(ctx context.Context) ApplicationSnapshotArrayOutput {
   188  	return pulumi.ToOutputWithContext(ctx, i).(ApplicationSnapshotArrayOutput)
   189  }
   190  
   191  // ApplicationSnapshotMapInput is an input type that accepts ApplicationSnapshotMap and ApplicationSnapshotMapOutput values.
   192  // You can construct a concrete instance of `ApplicationSnapshotMapInput` via:
   193  //
   194  //	ApplicationSnapshotMap{ "key": ApplicationSnapshotArgs{...} }
   195  type ApplicationSnapshotMapInput interface {
   196  	pulumi.Input
   197  
   198  	ToApplicationSnapshotMapOutput() ApplicationSnapshotMapOutput
   199  	ToApplicationSnapshotMapOutputWithContext(context.Context) ApplicationSnapshotMapOutput
   200  }
   201  
   202  type ApplicationSnapshotMap map[string]ApplicationSnapshotInput
   203  
   204  func (ApplicationSnapshotMap) ElementType() reflect.Type {
   205  	return reflect.TypeOf((*map[string]*ApplicationSnapshot)(nil)).Elem()
   206  }
   207  
   208  func (i ApplicationSnapshotMap) ToApplicationSnapshotMapOutput() ApplicationSnapshotMapOutput {
   209  	return i.ToApplicationSnapshotMapOutputWithContext(context.Background())
   210  }
   211  
   212  func (i ApplicationSnapshotMap) ToApplicationSnapshotMapOutputWithContext(ctx context.Context) ApplicationSnapshotMapOutput {
   213  	return pulumi.ToOutputWithContext(ctx, i).(ApplicationSnapshotMapOutput)
   214  }
   215  
   216  type ApplicationSnapshotOutput struct{ *pulumi.OutputState }
   217  
   218  func (ApplicationSnapshotOutput) ElementType() reflect.Type {
   219  	return reflect.TypeOf((**ApplicationSnapshot)(nil)).Elem()
   220  }
   221  
   222  func (o ApplicationSnapshotOutput) ToApplicationSnapshotOutput() ApplicationSnapshotOutput {
   223  	return o
   224  }
   225  
   226  func (o ApplicationSnapshotOutput) ToApplicationSnapshotOutputWithContext(ctx context.Context) ApplicationSnapshotOutput {
   227  	return o
   228  }
   229  
   230  // The name of an existing  Kinesis Analytics v2 Application. Note that the application must be running for a snapshot to be created.
   231  func (o ApplicationSnapshotOutput) ApplicationName() pulumi.StringOutput {
   232  	return o.ApplyT(func(v *ApplicationSnapshot) pulumi.StringOutput { return v.ApplicationName }).(pulumi.StringOutput)
   233  }
   234  
   235  // The current application version ID when the snapshot was created.
   236  func (o ApplicationSnapshotOutput) ApplicationVersionId() pulumi.IntOutput {
   237  	return o.ApplyT(func(v *ApplicationSnapshot) pulumi.IntOutput { return v.ApplicationVersionId }).(pulumi.IntOutput)
   238  }
   239  
   240  // The timestamp of the application snapshot.
   241  func (o ApplicationSnapshotOutput) SnapshotCreationTimestamp() pulumi.StringOutput {
   242  	return o.ApplyT(func(v *ApplicationSnapshot) pulumi.StringOutput { return v.SnapshotCreationTimestamp }).(pulumi.StringOutput)
   243  }
   244  
   245  // The name of the application snapshot.
   246  func (o ApplicationSnapshotOutput) SnapshotName() pulumi.StringOutput {
   247  	return o.ApplyT(func(v *ApplicationSnapshot) pulumi.StringOutput { return v.SnapshotName }).(pulumi.StringOutput)
   248  }
   249  
   250  type ApplicationSnapshotArrayOutput struct{ *pulumi.OutputState }
   251  
   252  func (ApplicationSnapshotArrayOutput) ElementType() reflect.Type {
   253  	return reflect.TypeOf((*[]*ApplicationSnapshot)(nil)).Elem()
   254  }
   255  
   256  func (o ApplicationSnapshotArrayOutput) ToApplicationSnapshotArrayOutput() ApplicationSnapshotArrayOutput {
   257  	return o
   258  }
   259  
   260  func (o ApplicationSnapshotArrayOutput) ToApplicationSnapshotArrayOutputWithContext(ctx context.Context) ApplicationSnapshotArrayOutput {
   261  	return o
   262  }
   263  
   264  func (o ApplicationSnapshotArrayOutput) Index(i pulumi.IntInput) ApplicationSnapshotOutput {
   265  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ApplicationSnapshot {
   266  		return vs[0].([]*ApplicationSnapshot)[vs[1].(int)]
   267  	}).(ApplicationSnapshotOutput)
   268  }
   269  
   270  type ApplicationSnapshotMapOutput struct{ *pulumi.OutputState }
   271  
   272  func (ApplicationSnapshotMapOutput) ElementType() reflect.Type {
   273  	return reflect.TypeOf((*map[string]*ApplicationSnapshot)(nil)).Elem()
   274  }
   275  
   276  func (o ApplicationSnapshotMapOutput) ToApplicationSnapshotMapOutput() ApplicationSnapshotMapOutput {
   277  	return o
   278  }
   279  
   280  func (o ApplicationSnapshotMapOutput) ToApplicationSnapshotMapOutputWithContext(ctx context.Context) ApplicationSnapshotMapOutput {
   281  	return o
   282  }
   283  
   284  func (o ApplicationSnapshotMapOutput) MapIndex(k pulumi.StringInput) ApplicationSnapshotOutput {
   285  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ApplicationSnapshot {
   286  		return vs[0].(map[string]*ApplicationSnapshot)[vs[1].(string)]
   287  	}).(ApplicationSnapshotOutput)
   288  }
   289  
   290  func init() {
   291  	pulumi.RegisterInputType(reflect.TypeOf((*ApplicationSnapshotInput)(nil)).Elem(), &ApplicationSnapshot{})
   292  	pulumi.RegisterInputType(reflect.TypeOf((*ApplicationSnapshotArrayInput)(nil)).Elem(), ApplicationSnapshotArray{})
   293  	pulumi.RegisterInputType(reflect.TypeOf((*ApplicationSnapshotMapInput)(nil)).Elem(), ApplicationSnapshotMap{})
   294  	pulumi.RegisterOutputType(ApplicationSnapshotOutput{})
   295  	pulumi.RegisterOutputType(ApplicationSnapshotArrayOutput{})
   296  	pulumi.RegisterOutputType(ApplicationSnapshotMapOutput{})
   297  }