github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/redshift/partner.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 redshift 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 // Creates a new Amazon Redshift Partner Integration. 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/redshift" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // _, err := redshift.NewPartner(ctx, "example", &redshift.PartnerArgs{ 33 // ClusterIdentifier: pulumi.Any(exampleAwsRedshiftCluster.Id), 34 // AccountId: pulumi.String("1234567910"), 35 // DatabaseName: pulumi.Any(exampleAwsRedshiftCluster.DatabaseName), 36 // PartnerName: pulumi.String("example"), 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 Redshift usage limits using the `id`. For example: 51 // 52 // ```sh 53 // $ pulumi import aws:redshift/partner:Partner example 01234567910:cluster-example-id:example:example 54 // ``` 55 type Partner struct { 56 pulumi.CustomResourceState 57 58 // The Amazon Web Services account ID that owns the cluster. 59 AccountId pulumi.StringOutput `pulumi:"accountId"` 60 // The cluster identifier of the cluster that receives data from the partner. 61 ClusterIdentifier pulumi.StringOutput `pulumi:"clusterIdentifier"` 62 // The name of the database that receives data from the partner. 63 DatabaseName pulumi.StringOutput `pulumi:"databaseName"` 64 // The name of the partner that is authorized to send data. 65 PartnerName pulumi.StringOutput `pulumi:"partnerName"` 66 // (Optional) The partner integration status. 67 Status pulumi.StringOutput `pulumi:"status"` 68 // (Optional) The status message provided by the partner. 69 StatusMessage pulumi.StringOutput `pulumi:"statusMessage"` 70 } 71 72 // NewPartner registers a new resource with the given unique name, arguments, and options. 73 func NewPartner(ctx *pulumi.Context, 74 name string, args *PartnerArgs, opts ...pulumi.ResourceOption) (*Partner, error) { 75 if args == nil { 76 return nil, errors.New("missing one or more required arguments") 77 } 78 79 if args.AccountId == nil { 80 return nil, errors.New("invalid value for required argument 'AccountId'") 81 } 82 if args.ClusterIdentifier == nil { 83 return nil, errors.New("invalid value for required argument 'ClusterIdentifier'") 84 } 85 if args.DatabaseName == nil { 86 return nil, errors.New("invalid value for required argument 'DatabaseName'") 87 } 88 if args.PartnerName == nil { 89 return nil, errors.New("invalid value for required argument 'PartnerName'") 90 } 91 opts = internal.PkgResourceDefaultOpts(opts) 92 var resource Partner 93 err := ctx.RegisterResource("aws:redshift/partner:Partner", name, args, &resource, opts...) 94 if err != nil { 95 return nil, err 96 } 97 return &resource, nil 98 } 99 100 // GetPartner gets an existing Partner resource's state with the given name, ID, and optional 101 // state properties that are used to uniquely qualify the lookup (nil if not required). 102 func GetPartner(ctx *pulumi.Context, 103 name string, id pulumi.IDInput, state *PartnerState, opts ...pulumi.ResourceOption) (*Partner, error) { 104 var resource Partner 105 err := ctx.ReadResource("aws:redshift/partner:Partner", name, id, state, &resource, opts...) 106 if err != nil { 107 return nil, err 108 } 109 return &resource, nil 110 } 111 112 // Input properties used for looking up and filtering Partner resources. 113 type partnerState struct { 114 // The Amazon Web Services account ID that owns the cluster. 115 AccountId *string `pulumi:"accountId"` 116 // The cluster identifier of the cluster that receives data from the partner. 117 ClusterIdentifier *string `pulumi:"clusterIdentifier"` 118 // The name of the database that receives data from the partner. 119 DatabaseName *string `pulumi:"databaseName"` 120 // The name of the partner that is authorized to send data. 121 PartnerName *string `pulumi:"partnerName"` 122 // (Optional) The partner integration status. 123 Status *string `pulumi:"status"` 124 // (Optional) The status message provided by the partner. 125 StatusMessage *string `pulumi:"statusMessage"` 126 } 127 128 type PartnerState struct { 129 // The Amazon Web Services account ID that owns the cluster. 130 AccountId pulumi.StringPtrInput 131 // The cluster identifier of the cluster that receives data from the partner. 132 ClusterIdentifier pulumi.StringPtrInput 133 // The name of the database that receives data from the partner. 134 DatabaseName pulumi.StringPtrInput 135 // The name of the partner that is authorized to send data. 136 PartnerName pulumi.StringPtrInput 137 // (Optional) The partner integration status. 138 Status pulumi.StringPtrInput 139 // (Optional) The status message provided by the partner. 140 StatusMessage pulumi.StringPtrInput 141 } 142 143 func (PartnerState) ElementType() reflect.Type { 144 return reflect.TypeOf((*partnerState)(nil)).Elem() 145 } 146 147 type partnerArgs struct { 148 // The Amazon Web Services account ID that owns the cluster. 149 AccountId string `pulumi:"accountId"` 150 // The cluster identifier of the cluster that receives data from the partner. 151 ClusterIdentifier string `pulumi:"clusterIdentifier"` 152 // The name of the database that receives data from the partner. 153 DatabaseName string `pulumi:"databaseName"` 154 // The name of the partner that is authorized to send data. 155 PartnerName string `pulumi:"partnerName"` 156 } 157 158 // The set of arguments for constructing a Partner resource. 159 type PartnerArgs struct { 160 // The Amazon Web Services account ID that owns the cluster. 161 AccountId pulumi.StringInput 162 // The cluster identifier of the cluster that receives data from the partner. 163 ClusterIdentifier pulumi.StringInput 164 // The name of the database that receives data from the partner. 165 DatabaseName pulumi.StringInput 166 // The name of the partner that is authorized to send data. 167 PartnerName pulumi.StringInput 168 } 169 170 func (PartnerArgs) ElementType() reflect.Type { 171 return reflect.TypeOf((*partnerArgs)(nil)).Elem() 172 } 173 174 type PartnerInput interface { 175 pulumi.Input 176 177 ToPartnerOutput() PartnerOutput 178 ToPartnerOutputWithContext(ctx context.Context) PartnerOutput 179 } 180 181 func (*Partner) ElementType() reflect.Type { 182 return reflect.TypeOf((**Partner)(nil)).Elem() 183 } 184 185 func (i *Partner) ToPartnerOutput() PartnerOutput { 186 return i.ToPartnerOutputWithContext(context.Background()) 187 } 188 189 func (i *Partner) ToPartnerOutputWithContext(ctx context.Context) PartnerOutput { 190 return pulumi.ToOutputWithContext(ctx, i).(PartnerOutput) 191 } 192 193 // PartnerArrayInput is an input type that accepts PartnerArray and PartnerArrayOutput values. 194 // You can construct a concrete instance of `PartnerArrayInput` via: 195 // 196 // PartnerArray{ PartnerArgs{...} } 197 type PartnerArrayInput interface { 198 pulumi.Input 199 200 ToPartnerArrayOutput() PartnerArrayOutput 201 ToPartnerArrayOutputWithContext(context.Context) PartnerArrayOutput 202 } 203 204 type PartnerArray []PartnerInput 205 206 func (PartnerArray) ElementType() reflect.Type { 207 return reflect.TypeOf((*[]*Partner)(nil)).Elem() 208 } 209 210 func (i PartnerArray) ToPartnerArrayOutput() PartnerArrayOutput { 211 return i.ToPartnerArrayOutputWithContext(context.Background()) 212 } 213 214 func (i PartnerArray) ToPartnerArrayOutputWithContext(ctx context.Context) PartnerArrayOutput { 215 return pulumi.ToOutputWithContext(ctx, i).(PartnerArrayOutput) 216 } 217 218 // PartnerMapInput is an input type that accepts PartnerMap and PartnerMapOutput values. 219 // You can construct a concrete instance of `PartnerMapInput` via: 220 // 221 // PartnerMap{ "key": PartnerArgs{...} } 222 type PartnerMapInput interface { 223 pulumi.Input 224 225 ToPartnerMapOutput() PartnerMapOutput 226 ToPartnerMapOutputWithContext(context.Context) PartnerMapOutput 227 } 228 229 type PartnerMap map[string]PartnerInput 230 231 func (PartnerMap) ElementType() reflect.Type { 232 return reflect.TypeOf((*map[string]*Partner)(nil)).Elem() 233 } 234 235 func (i PartnerMap) ToPartnerMapOutput() PartnerMapOutput { 236 return i.ToPartnerMapOutputWithContext(context.Background()) 237 } 238 239 func (i PartnerMap) ToPartnerMapOutputWithContext(ctx context.Context) PartnerMapOutput { 240 return pulumi.ToOutputWithContext(ctx, i).(PartnerMapOutput) 241 } 242 243 type PartnerOutput struct{ *pulumi.OutputState } 244 245 func (PartnerOutput) ElementType() reflect.Type { 246 return reflect.TypeOf((**Partner)(nil)).Elem() 247 } 248 249 func (o PartnerOutput) ToPartnerOutput() PartnerOutput { 250 return o 251 } 252 253 func (o PartnerOutput) ToPartnerOutputWithContext(ctx context.Context) PartnerOutput { 254 return o 255 } 256 257 // The Amazon Web Services account ID that owns the cluster. 258 func (o PartnerOutput) AccountId() pulumi.StringOutput { 259 return o.ApplyT(func(v *Partner) pulumi.StringOutput { return v.AccountId }).(pulumi.StringOutput) 260 } 261 262 // The cluster identifier of the cluster that receives data from the partner. 263 func (o PartnerOutput) ClusterIdentifier() pulumi.StringOutput { 264 return o.ApplyT(func(v *Partner) pulumi.StringOutput { return v.ClusterIdentifier }).(pulumi.StringOutput) 265 } 266 267 // The name of the database that receives data from the partner. 268 func (o PartnerOutput) DatabaseName() pulumi.StringOutput { 269 return o.ApplyT(func(v *Partner) pulumi.StringOutput { return v.DatabaseName }).(pulumi.StringOutput) 270 } 271 272 // The name of the partner that is authorized to send data. 273 func (o PartnerOutput) PartnerName() pulumi.StringOutput { 274 return o.ApplyT(func(v *Partner) pulumi.StringOutput { return v.PartnerName }).(pulumi.StringOutput) 275 } 276 277 // (Optional) The partner integration status. 278 func (o PartnerOutput) Status() pulumi.StringOutput { 279 return o.ApplyT(func(v *Partner) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput) 280 } 281 282 // (Optional) The status message provided by the partner. 283 func (o PartnerOutput) StatusMessage() pulumi.StringOutput { 284 return o.ApplyT(func(v *Partner) pulumi.StringOutput { return v.StatusMessage }).(pulumi.StringOutput) 285 } 286 287 type PartnerArrayOutput struct{ *pulumi.OutputState } 288 289 func (PartnerArrayOutput) ElementType() reflect.Type { 290 return reflect.TypeOf((*[]*Partner)(nil)).Elem() 291 } 292 293 func (o PartnerArrayOutput) ToPartnerArrayOutput() PartnerArrayOutput { 294 return o 295 } 296 297 func (o PartnerArrayOutput) ToPartnerArrayOutputWithContext(ctx context.Context) PartnerArrayOutput { 298 return o 299 } 300 301 func (o PartnerArrayOutput) Index(i pulumi.IntInput) PartnerOutput { 302 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Partner { 303 return vs[0].([]*Partner)[vs[1].(int)] 304 }).(PartnerOutput) 305 } 306 307 type PartnerMapOutput struct{ *pulumi.OutputState } 308 309 func (PartnerMapOutput) ElementType() reflect.Type { 310 return reflect.TypeOf((*map[string]*Partner)(nil)).Elem() 311 } 312 313 func (o PartnerMapOutput) ToPartnerMapOutput() PartnerMapOutput { 314 return o 315 } 316 317 func (o PartnerMapOutput) ToPartnerMapOutputWithContext(ctx context.Context) PartnerMapOutput { 318 return o 319 } 320 321 func (o PartnerMapOutput) MapIndex(k pulumi.StringInput) PartnerOutput { 322 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Partner { 323 return vs[0].(map[string]*Partner)[vs[1].(string)] 324 }).(PartnerOutput) 325 } 326 327 func init() { 328 pulumi.RegisterInputType(reflect.TypeOf((*PartnerInput)(nil)).Elem(), &Partner{}) 329 pulumi.RegisterInputType(reflect.TypeOf((*PartnerArrayInput)(nil)).Elem(), PartnerArray{}) 330 pulumi.RegisterInputType(reflect.TypeOf((*PartnerMapInput)(nil)).Elem(), PartnerMap{}) 331 pulumi.RegisterOutputType(PartnerOutput{}) 332 pulumi.RegisterOutputType(PartnerArrayOutput{}) 333 pulumi.RegisterOutputType(PartnerMapOutput{}) 334 }