github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/qldb/ledger.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 qldb
     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 AWS Quantum Ledger Database (QLDB) resource
    16  //
    17  // > **NOTE:** Deletion protection is enabled by default. To successfully delete this resource via this provider, `deletionProtection = false` must be applied before attempting deletion.
    18  //
    19  // ## Example Usage
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/qldb"
    28  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    29  //
    30  // )
    31  //
    32  //	func main() {
    33  //		pulumi.Run(func(ctx *pulumi.Context) error {
    34  //			_, err := qldb.NewLedger(ctx, "sample-ledger", &qldb.LedgerArgs{
    35  //				Name:            pulumi.String("sample-ledger"),
    36  //				PermissionsMode: pulumi.String("STANDARD"),
    37  //			})
    38  //			if err != nil {
    39  //				return err
    40  //			}
    41  //			return nil
    42  //		})
    43  //	}
    44  //
    45  // ```
    46  // <!--End PulumiCodeChooser -->
    47  //
    48  // ## Import
    49  //
    50  // Using `pulumi import`, import QLDB Ledgers using the `name`. For example:
    51  //
    52  // ```sh
    53  // $ pulumi import aws:qldb/ledger:Ledger sample-ledger sample-ledger
    54  // ```
    55  type Ledger struct {
    56  	pulumi.CustomResourceState
    57  
    58  	// The ARN of the QLDB Ledger
    59  	Arn pulumi.StringOutput `pulumi:"arn"`
    60  	// The deletion protection for the QLDB Ledger instance. By default it is `true`. To delete this resource via the provider, this value must be configured to `false` and applied first before attempting deletion.
    61  	DeletionProtection pulumi.BoolPtrOutput `pulumi:"deletionProtection"`
    62  	// The key in AWS Key Management Service (AWS KMS) to use for encryption of data at rest in the ledger. For more information, see the [AWS documentation](https://docs.aws.amazon.com/qldb/latest/developerguide/encryption-at-rest.html). Valid values are `"AWS_OWNED_KMS_KEY"` to use an AWS KMS key that is owned and managed by AWS on your behalf, or the ARN of a valid symmetric customer managed KMS key.
    63  	KmsKey pulumi.StringOutput `pulumi:"kmsKey"`
    64  	// The friendly name for the QLDB Ledger instance. By default generated by the provider.
    65  	Name pulumi.StringOutput `pulumi:"name"`
    66  	// The permissions mode for the QLDB ledger instance. Specify either `ALLOW_ALL` or `STANDARD`.
    67  	PermissionsMode pulumi.StringOutput `pulumi:"permissionsMode"`
    68  	// 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.
    69  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    70  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    71  	//
    72  	// Deprecated: Please use `tags` instead.
    73  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    74  }
    75  
    76  // NewLedger registers a new resource with the given unique name, arguments, and options.
    77  func NewLedger(ctx *pulumi.Context,
    78  	name string, args *LedgerArgs, opts ...pulumi.ResourceOption) (*Ledger, error) {
    79  	if args == nil {
    80  		return nil, errors.New("missing one or more required arguments")
    81  	}
    82  
    83  	if args.PermissionsMode == nil {
    84  		return nil, errors.New("invalid value for required argument 'PermissionsMode'")
    85  	}
    86  	opts = internal.PkgResourceDefaultOpts(opts)
    87  	var resource Ledger
    88  	err := ctx.RegisterResource("aws:qldb/ledger:Ledger", name, args, &resource, opts...)
    89  	if err != nil {
    90  		return nil, err
    91  	}
    92  	return &resource, nil
    93  }
    94  
    95  // GetLedger gets an existing Ledger resource's state with the given name, ID, and optional
    96  // state properties that are used to uniquely qualify the lookup (nil if not required).
    97  func GetLedger(ctx *pulumi.Context,
    98  	name string, id pulumi.IDInput, state *LedgerState, opts ...pulumi.ResourceOption) (*Ledger, error) {
    99  	var resource Ledger
   100  	err := ctx.ReadResource("aws:qldb/ledger:Ledger", name, id, state, &resource, opts...)
   101  	if err != nil {
   102  		return nil, err
   103  	}
   104  	return &resource, nil
   105  }
   106  
   107  // Input properties used for looking up and filtering Ledger resources.
   108  type ledgerState struct {
   109  	// The ARN of the QLDB Ledger
   110  	Arn *string `pulumi:"arn"`
   111  	// The deletion protection for the QLDB Ledger instance. By default it is `true`. To delete this resource via the provider, this value must be configured to `false` and applied first before attempting deletion.
   112  	DeletionProtection *bool `pulumi:"deletionProtection"`
   113  	// The key in AWS Key Management Service (AWS KMS) to use for encryption of data at rest in the ledger. For more information, see the [AWS documentation](https://docs.aws.amazon.com/qldb/latest/developerguide/encryption-at-rest.html). Valid values are `"AWS_OWNED_KMS_KEY"` to use an AWS KMS key that is owned and managed by AWS on your behalf, or the ARN of a valid symmetric customer managed KMS key.
   114  	KmsKey *string `pulumi:"kmsKey"`
   115  	// The friendly name for the QLDB Ledger instance. By default generated by the provider.
   116  	Name *string `pulumi:"name"`
   117  	// The permissions mode for the QLDB ledger instance. Specify either `ALLOW_ALL` or `STANDARD`.
   118  	PermissionsMode *string `pulumi:"permissionsMode"`
   119  	// 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.
   120  	Tags map[string]string `pulumi:"tags"`
   121  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   122  	//
   123  	// Deprecated: Please use `tags` instead.
   124  	TagsAll map[string]string `pulumi:"tagsAll"`
   125  }
   126  
   127  type LedgerState struct {
   128  	// The ARN of the QLDB Ledger
   129  	Arn pulumi.StringPtrInput
   130  	// The deletion protection for the QLDB Ledger instance. By default it is `true`. To delete this resource via the provider, this value must be configured to `false` and applied first before attempting deletion.
   131  	DeletionProtection pulumi.BoolPtrInput
   132  	// The key in AWS Key Management Service (AWS KMS) to use for encryption of data at rest in the ledger. For more information, see the [AWS documentation](https://docs.aws.amazon.com/qldb/latest/developerguide/encryption-at-rest.html). Valid values are `"AWS_OWNED_KMS_KEY"` to use an AWS KMS key that is owned and managed by AWS on your behalf, or the ARN of a valid symmetric customer managed KMS key.
   133  	KmsKey pulumi.StringPtrInput
   134  	// The friendly name for the QLDB Ledger instance. By default generated by the provider.
   135  	Name pulumi.StringPtrInput
   136  	// The permissions mode for the QLDB ledger instance. Specify either `ALLOW_ALL` or `STANDARD`.
   137  	PermissionsMode pulumi.StringPtrInput
   138  	// 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.
   139  	Tags pulumi.StringMapInput
   140  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   141  	//
   142  	// Deprecated: Please use `tags` instead.
   143  	TagsAll pulumi.StringMapInput
   144  }
   145  
   146  func (LedgerState) ElementType() reflect.Type {
   147  	return reflect.TypeOf((*ledgerState)(nil)).Elem()
   148  }
   149  
   150  type ledgerArgs struct {
   151  	// The deletion protection for the QLDB Ledger instance. By default it is `true`. To delete this resource via the provider, this value must be configured to `false` and applied first before attempting deletion.
   152  	DeletionProtection *bool `pulumi:"deletionProtection"`
   153  	// The key in AWS Key Management Service (AWS KMS) to use for encryption of data at rest in the ledger. For more information, see the [AWS documentation](https://docs.aws.amazon.com/qldb/latest/developerguide/encryption-at-rest.html). Valid values are `"AWS_OWNED_KMS_KEY"` to use an AWS KMS key that is owned and managed by AWS on your behalf, or the ARN of a valid symmetric customer managed KMS key.
   154  	KmsKey *string `pulumi:"kmsKey"`
   155  	// The friendly name for the QLDB Ledger instance. By default generated by the provider.
   156  	Name *string `pulumi:"name"`
   157  	// The permissions mode for the QLDB ledger instance. Specify either `ALLOW_ALL` or `STANDARD`.
   158  	PermissionsMode string `pulumi:"permissionsMode"`
   159  	// 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.
   160  	Tags map[string]string `pulumi:"tags"`
   161  }
   162  
   163  // The set of arguments for constructing a Ledger resource.
   164  type LedgerArgs struct {
   165  	// The deletion protection for the QLDB Ledger instance. By default it is `true`. To delete this resource via the provider, this value must be configured to `false` and applied first before attempting deletion.
   166  	DeletionProtection pulumi.BoolPtrInput
   167  	// The key in AWS Key Management Service (AWS KMS) to use for encryption of data at rest in the ledger. For more information, see the [AWS documentation](https://docs.aws.amazon.com/qldb/latest/developerguide/encryption-at-rest.html). Valid values are `"AWS_OWNED_KMS_KEY"` to use an AWS KMS key that is owned and managed by AWS on your behalf, or the ARN of a valid symmetric customer managed KMS key.
   168  	KmsKey pulumi.StringPtrInput
   169  	// The friendly name for the QLDB Ledger instance. By default generated by the provider.
   170  	Name pulumi.StringPtrInput
   171  	// The permissions mode for the QLDB ledger instance. Specify either `ALLOW_ALL` or `STANDARD`.
   172  	PermissionsMode pulumi.StringInput
   173  	// 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.
   174  	Tags pulumi.StringMapInput
   175  }
   176  
   177  func (LedgerArgs) ElementType() reflect.Type {
   178  	return reflect.TypeOf((*ledgerArgs)(nil)).Elem()
   179  }
   180  
   181  type LedgerInput interface {
   182  	pulumi.Input
   183  
   184  	ToLedgerOutput() LedgerOutput
   185  	ToLedgerOutputWithContext(ctx context.Context) LedgerOutput
   186  }
   187  
   188  func (*Ledger) ElementType() reflect.Type {
   189  	return reflect.TypeOf((**Ledger)(nil)).Elem()
   190  }
   191  
   192  func (i *Ledger) ToLedgerOutput() LedgerOutput {
   193  	return i.ToLedgerOutputWithContext(context.Background())
   194  }
   195  
   196  func (i *Ledger) ToLedgerOutputWithContext(ctx context.Context) LedgerOutput {
   197  	return pulumi.ToOutputWithContext(ctx, i).(LedgerOutput)
   198  }
   199  
   200  // LedgerArrayInput is an input type that accepts LedgerArray and LedgerArrayOutput values.
   201  // You can construct a concrete instance of `LedgerArrayInput` via:
   202  //
   203  //	LedgerArray{ LedgerArgs{...} }
   204  type LedgerArrayInput interface {
   205  	pulumi.Input
   206  
   207  	ToLedgerArrayOutput() LedgerArrayOutput
   208  	ToLedgerArrayOutputWithContext(context.Context) LedgerArrayOutput
   209  }
   210  
   211  type LedgerArray []LedgerInput
   212  
   213  func (LedgerArray) ElementType() reflect.Type {
   214  	return reflect.TypeOf((*[]*Ledger)(nil)).Elem()
   215  }
   216  
   217  func (i LedgerArray) ToLedgerArrayOutput() LedgerArrayOutput {
   218  	return i.ToLedgerArrayOutputWithContext(context.Background())
   219  }
   220  
   221  func (i LedgerArray) ToLedgerArrayOutputWithContext(ctx context.Context) LedgerArrayOutput {
   222  	return pulumi.ToOutputWithContext(ctx, i).(LedgerArrayOutput)
   223  }
   224  
   225  // LedgerMapInput is an input type that accepts LedgerMap and LedgerMapOutput values.
   226  // You can construct a concrete instance of `LedgerMapInput` via:
   227  //
   228  //	LedgerMap{ "key": LedgerArgs{...} }
   229  type LedgerMapInput interface {
   230  	pulumi.Input
   231  
   232  	ToLedgerMapOutput() LedgerMapOutput
   233  	ToLedgerMapOutputWithContext(context.Context) LedgerMapOutput
   234  }
   235  
   236  type LedgerMap map[string]LedgerInput
   237  
   238  func (LedgerMap) ElementType() reflect.Type {
   239  	return reflect.TypeOf((*map[string]*Ledger)(nil)).Elem()
   240  }
   241  
   242  func (i LedgerMap) ToLedgerMapOutput() LedgerMapOutput {
   243  	return i.ToLedgerMapOutputWithContext(context.Background())
   244  }
   245  
   246  func (i LedgerMap) ToLedgerMapOutputWithContext(ctx context.Context) LedgerMapOutput {
   247  	return pulumi.ToOutputWithContext(ctx, i).(LedgerMapOutput)
   248  }
   249  
   250  type LedgerOutput struct{ *pulumi.OutputState }
   251  
   252  func (LedgerOutput) ElementType() reflect.Type {
   253  	return reflect.TypeOf((**Ledger)(nil)).Elem()
   254  }
   255  
   256  func (o LedgerOutput) ToLedgerOutput() LedgerOutput {
   257  	return o
   258  }
   259  
   260  func (o LedgerOutput) ToLedgerOutputWithContext(ctx context.Context) LedgerOutput {
   261  	return o
   262  }
   263  
   264  // The ARN of the QLDB Ledger
   265  func (o LedgerOutput) Arn() pulumi.StringOutput {
   266  	return o.ApplyT(func(v *Ledger) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   267  }
   268  
   269  // The deletion protection for the QLDB Ledger instance. By default it is `true`. To delete this resource via the provider, this value must be configured to `false` and applied first before attempting deletion.
   270  func (o LedgerOutput) DeletionProtection() pulumi.BoolPtrOutput {
   271  	return o.ApplyT(func(v *Ledger) pulumi.BoolPtrOutput { return v.DeletionProtection }).(pulumi.BoolPtrOutput)
   272  }
   273  
   274  // The key in AWS Key Management Service (AWS KMS) to use for encryption of data at rest in the ledger. For more information, see the [AWS documentation](https://docs.aws.amazon.com/qldb/latest/developerguide/encryption-at-rest.html). Valid values are `"AWS_OWNED_KMS_KEY"` to use an AWS KMS key that is owned and managed by AWS on your behalf, or the ARN of a valid symmetric customer managed KMS key.
   275  func (o LedgerOutput) KmsKey() pulumi.StringOutput {
   276  	return o.ApplyT(func(v *Ledger) pulumi.StringOutput { return v.KmsKey }).(pulumi.StringOutput)
   277  }
   278  
   279  // The friendly name for the QLDB Ledger instance. By default generated by the provider.
   280  func (o LedgerOutput) Name() pulumi.StringOutput {
   281  	return o.ApplyT(func(v *Ledger) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   282  }
   283  
   284  // The permissions mode for the QLDB ledger instance. Specify either `ALLOW_ALL` or `STANDARD`.
   285  func (o LedgerOutput) PermissionsMode() pulumi.StringOutput {
   286  	return o.ApplyT(func(v *Ledger) pulumi.StringOutput { return v.PermissionsMode }).(pulumi.StringOutput)
   287  }
   288  
   289  // 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.
   290  func (o LedgerOutput) Tags() pulumi.StringMapOutput {
   291  	return o.ApplyT(func(v *Ledger) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   292  }
   293  
   294  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   295  //
   296  // Deprecated: Please use `tags` instead.
   297  func (o LedgerOutput) TagsAll() pulumi.StringMapOutput {
   298  	return o.ApplyT(func(v *Ledger) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   299  }
   300  
   301  type LedgerArrayOutput struct{ *pulumi.OutputState }
   302  
   303  func (LedgerArrayOutput) ElementType() reflect.Type {
   304  	return reflect.TypeOf((*[]*Ledger)(nil)).Elem()
   305  }
   306  
   307  func (o LedgerArrayOutput) ToLedgerArrayOutput() LedgerArrayOutput {
   308  	return o
   309  }
   310  
   311  func (o LedgerArrayOutput) ToLedgerArrayOutputWithContext(ctx context.Context) LedgerArrayOutput {
   312  	return o
   313  }
   314  
   315  func (o LedgerArrayOutput) Index(i pulumi.IntInput) LedgerOutput {
   316  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Ledger {
   317  		return vs[0].([]*Ledger)[vs[1].(int)]
   318  	}).(LedgerOutput)
   319  }
   320  
   321  type LedgerMapOutput struct{ *pulumi.OutputState }
   322  
   323  func (LedgerMapOutput) ElementType() reflect.Type {
   324  	return reflect.TypeOf((*map[string]*Ledger)(nil)).Elem()
   325  }
   326  
   327  func (o LedgerMapOutput) ToLedgerMapOutput() LedgerMapOutput {
   328  	return o
   329  }
   330  
   331  func (o LedgerMapOutput) ToLedgerMapOutputWithContext(ctx context.Context) LedgerMapOutput {
   332  	return o
   333  }
   334  
   335  func (o LedgerMapOutput) MapIndex(k pulumi.StringInput) LedgerOutput {
   336  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Ledger {
   337  		return vs[0].(map[string]*Ledger)[vs[1].(string)]
   338  	}).(LedgerOutput)
   339  }
   340  
   341  func init() {
   342  	pulumi.RegisterInputType(reflect.TypeOf((*LedgerInput)(nil)).Elem(), &Ledger{})
   343  	pulumi.RegisterInputType(reflect.TypeOf((*LedgerArrayInput)(nil)).Elem(), LedgerArray{})
   344  	pulumi.RegisterInputType(reflect.TypeOf((*LedgerMapInput)(nil)).Elem(), LedgerMap{})
   345  	pulumi.RegisterOutputType(LedgerOutput{})
   346  	pulumi.RegisterOutputType(LedgerArrayOutput{})
   347  	pulumi.RegisterOutputType(LedgerMapOutput{})
   348  }