github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/redshiftserverless/getNamespace.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 redshiftserverless
     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  // Data source for managing an AWS Redshift Serverless Namespace.
    15  //
    16  // ## Example Usage
    17  //
    18  // <!--Start PulumiCodeChooser -->
    19  // ```go
    20  // package main
    21  //
    22  // import (
    23  //
    24  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/redshiftserverless"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			_, err := redshiftserverless.LookupNamespace(ctx, &redshiftserverless.LookupNamespaceArgs{
    32  //				NamespaceName: "example-namespace",
    33  //			}, nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			return nil
    38  //		})
    39  //	}
    40  //
    41  // ```
    42  // <!--End PulumiCodeChooser -->
    43  func LookupNamespace(ctx *pulumi.Context, args *LookupNamespaceArgs, opts ...pulumi.InvokeOption) (*LookupNamespaceResult, error) {
    44  	opts = internal.PkgInvokeDefaultOpts(opts)
    45  	var rv LookupNamespaceResult
    46  	err := ctx.Invoke("aws:redshiftserverless/getNamespace:getNamespace", args, &rv, opts...)
    47  	if err != nil {
    48  		return nil, err
    49  	}
    50  	return &rv, nil
    51  }
    52  
    53  // A collection of arguments for invoking getNamespace.
    54  type LookupNamespaceArgs struct {
    55  	// The name of the namespace.
    56  	NamespaceName string `pulumi:"namespaceName"`
    57  }
    58  
    59  // A collection of values returned by getNamespace.
    60  type LookupNamespaceResult struct {
    61  	// The username of the administrator for the first database created in the namespace.
    62  	AdminUsername string `pulumi:"adminUsername"`
    63  	// Amazon Resource Name (ARN) of the Redshift Serverless Namespace.
    64  	Arn string `pulumi:"arn"`
    65  	// The name of the first database created in the namespace.
    66  	DbName string `pulumi:"dbName"`
    67  	// The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace. When specifying `defaultIamRoleArn`, it also must be part of `iamRoles`.
    68  	DefaultIamRoleArn string `pulumi:"defaultIamRoleArn"`
    69  	// A list of IAM roles to associate with the namespace.
    70  	IamRoles []string `pulumi:"iamRoles"`
    71  	// The provider-assigned unique ID for this managed resource.
    72  	Id string `pulumi:"id"`
    73  	// The ARN of the Amazon Web Services Key Management Service key used to encrypt your data.
    74  	KmsKeyId string `pulumi:"kmsKeyId"`
    75  	// The types of logs the namespace can export. Available export types are `userlog`, `connectionlog`, and `useractivitylog`.
    76  	LogExports []string `pulumi:"logExports"`
    77  	// The Redshift Namespace ID.
    78  	NamespaceId   string `pulumi:"namespaceId"`
    79  	NamespaceName string `pulumi:"namespaceName"`
    80  }
    81  
    82  func LookupNamespaceOutput(ctx *pulumi.Context, args LookupNamespaceOutputArgs, opts ...pulumi.InvokeOption) LookupNamespaceResultOutput {
    83  	return pulumi.ToOutputWithContext(context.Background(), args).
    84  		ApplyT(func(v interface{}) (LookupNamespaceResult, error) {
    85  			args := v.(LookupNamespaceArgs)
    86  			r, err := LookupNamespace(ctx, &args, opts...)
    87  			var s LookupNamespaceResult
    88  			if r != nil {
    89  				s = *r
    90  			}
    91  			return s, err
    92  		}).(LookupNamespaceResultOutput)
    93  }
    94  
    95  // A collection of arguments for invoking getNamespace.
    96  type LookupNamespaceOutputArgs struct {
    97  	// The name of the namespace.
    98  	NamespaceName pulumi.StringInput `pulumi:"namespaceName"`
    99  }
   100  
   101  func (LookupNamespaceOutputArgs) ElementType() reflect.Type {
   102  	return reflect.TypeOf((*LookupNamespaceArgs)(nil)).Elem()
   103  }
   104  
   105  // A collection of values returned by getNamespace.
   106  type LookupNamespaceResultOutput struct{ *pulumi.OutputState }
   107  
   108  func (LookupNamespaceResultOutput) ElementType() reflect.Type {
   109  	return reflect.TypeOf((*LookupNamespaceResult)(nil)).Elem()
   110  }
   111  
   112  func (o LookupNamespaceResultOutput) ToLookupNamespaceResultOutput() LookupNamespaceResultOutput {
   113  	return o
   114  }
   115  
   116  func (o LookupNamespaceResultOutput) ToLookupNamespaceResultOutputWithContext(ctx context.Context) LookupNamespaceResultOutput {
   117  	return o
   118  }
   119  
   120  // The username of the administrator for the first database created in the namespace.
   121  func (o LookupNamespaceResultOutput) AdminUsername() pulumi.StringOutput {
   122  	return o.ApplyT(func(v LookupNamespaceResult) string { return v.AdminUsername }).(pulumi.StringOutput)
   123  }
   124  
   125  // Amazon Resource Name (ARN) of the Redshift Serverless Namespace.
   126  func (o LookupNamespaceResultOutput) Arn() pulumi.StringOutput {
   127  	return o.ApplyT(func(v LookupNamespaceResult) string { return v.Arn }).(pulumi.StringOutput)
   128  }
   129  
   130  // The name of the first database created in the namespace.
   131  func (o LookupNamespaceResultOutput) DbName() pulumi.StringOutput {
   132  	return o.ApplyT(func(v LookupNamespaceResult) string { return v.DbName }).(pulumi.StringOutput)
   133  }
   134  
   135  // The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace. When specifying `defaultIamRoleArn`, it also must be part of `iamRoles`.
   136  func (o LookupNamespaceResultOutput) DefaultIamRoleArn() pulumi.StringOutput {
   137  	return o.ApplyT(func(v LookupNamespaceResult) string { return v.DefaultIamRoleArn }).(pulumi.StringOutput)
   138  }
   139  
   140  // A list of IAM roles to associate with the namespace.
   141  func (o LookupNamespaceResultOutput) IamRoles() pulumi.StringArrayOutput {
   142  	return o.ApplyT(func(v LookupNamespaceResult) []string { return v.IamRoles }).(pulumi.StringArrayOutput)
   143  }
   144  
   145  // The provider-assigned unique ID for this managed resource.
   146  func (o LookupNamespaceResultOutput) Id() pulumi.StringOutput {
   147  	return o.ApplyT(func(v LookupNamespaceResult) string { return v.Id }).(pulumi.StringOutput)
   148  }
   149  
   150  // The ARN of the Amazon Web Services Key Management Service key used to encrypt your data.
   151  func (o LookupNamespaceResultOutput) KmsKeyId() pulumi.StringOutput {
   152  	return o.ApplyT(func(v LookupNamespaceResult) string { return v.KmsKeyId }).(pulumi.StringOutput)
   153  }
   154  
   155  // The types of logs the namespace can export. Available export types are `userlog`, `connectionlog`, and `useractivitylog`.
   156  func (o LookupNamespaceResultOutput) LogExports() pulumi.StringArrayOutput {
   157  	return o.ApplyT(func(v LookupNamespaceResult) []string { return v.LogExports }).(pulumi.StringArrayOutput)
   158  }
   159  
   160  // The Redshift Namespace ID.
   161  func (o LookupNamespaceResultOutput) NamespaceId() pulumi.StringOutput {
   162  	return o.ApplyT(func(v LookupNamespaceResult) string { return v.NamespaceId }).(pulumi.StringOutput)
   163  }
   164  
   165  func (o LookupNamespaceResultOutput) NamespaceName() pulumi.StringOutput {
   166  	return o.ApplyT(func(v LookupNamespaceResult) string { return v.NamespaceName }).(pulumi.StringOutput)
   167  }
   168  
   169  func init() {
   170  	pulumi.RegisterOutputType(LookupNamespaceResultOutput{})
   171  }