github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/redshift/endpointAccess.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 endpoint access. 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.NewEndpointAccess(ctx, "example", &redshift.EndpointAccessArgs{ 33 // EndpointName: pulumi.String("example"), 34 // SubnetGroupName: pulumi.Any(exampleAwsRedshiftSubnetGroup.Id), 35 // ClusterIdentifier: pulumi.Any(exampleAwsRedshiftCluster.ClusterIdentifier), 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 Redshift endpoint access using the `name`. For example: 50 // 51 // ```sh 52 // $ pulumi import aws:redshift/endpointAccess:EndpointAccess example example 53 // ``` 54 type EndpointAccess struct { 55 pulumi.CustomResourceState 56 57 // The DNS address of the endpoint. 58 Address pulumi.StringOutput `pulumi:"address"` 59 // The cluster identifier of the cluster to access. 60 ClusterIdentifier pulumi.StringOutput `pulumi:"clusterIdentifier"` 61 // The Redshift-managed VPC endpoint name. 62 EndpointName pulumi.StringOutput `pulumi:"endpointName"` 63 // The port number on which the cluster accepts incoming connections. 64 Port pulumi.IntOutput `pulumi:"port"` 65 // The Amazon Web Services account ID of the owner of the cluster. This is only required if the cluster is in another Amazon Web Services account. 66 ResourceOwner pulumi.StringOutput `pulumi:"resourceOwner"` 67 // The subnet group from which Amazon Redshift chooses the subnet to deploy the endpoint. 68 SubnetGroupName pulumi.StringOutput `pulumi:"subnetGroupName"` 69 // The connection endpoint for connecting to an Amazon Redshift cluster through the proxy. See details below. 70 VpcEndpoints EndpointAccessVpcEndpointArrayOutput `pulumi:"vpcEndpoints"` 71 // The security group that defines the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint. 72 VpcSecurityGroupIds pulumi.StringArrayOutput `pulumi:"vpcSecurityGroupIds"` 73 } 74 75 // NewEndpointAccess registers a new resource with the given unique name, arguments, and options. 76 func NewEndpointAccess(ctx *pulumi.Context, 77 name string, args *EndpointAccessArgs, opts ...pulumi.ResourceOption) (*EndpointAccess, error) { 78 if args == nil { 79 return nil, errors.New("missing one or more required arguments") 80 } 81 82 if args.ClusterIdentifier == nil { 83 return nil, errors.New("invalid value for required argument 'ClusterIdentifier'") 84 } 85 if args.EndpointName == nil { 86 return nil, errors.New("invalid value for required argument 'EndpointName'") 87 } 88 if args.SubnetGroupName == nil { 89 return nil, errors.New("invalid value for required argument 'SubnetGroupName'") 90 } 91 opts = internal.PkgResourceDefaultOpts(opts) 92 var resource EndpointAccess 93 err := ctx.RegisterResource("aws:redshift/endpointAccess:EndpointAccess", name, args, &resource, opts...) 94 if err != nil { 95 return nil, err 96 } 97 return &resource, nil 98 } 99 100 // GetEndpointAccess gets an existing EndpointAccess 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 GetEndpointAccess(ctx *pulumi.Context, 103 name string, id pulumi.IDInput, state *EndpointAccessState, opts ...pulumi.ResourceOption) (*EndpointAccess, error) { 104 var resource EndpointAccess 105 err := ctx.ReadResource("aws:redshift/endpointAccess:EndpointAccess", 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 EndpointAccess resources. 113 type endpointAccessState struct { 114 // The DNS address of the endpoint. 115 Address *string `pulumi:"address"` 116 // The cluster identifier of the cluster to access. 117 ClusterIdentifier *string `pulumi:"clusterIdentifier"` 118 // The Redshift-managed VPC endpoint name. 119 EndpointName *string `pulumi:"endpointName"` 120 // The port number on which the cluster accepts incoming connections. 121 Port *int `pulumi:"port"` 122 // The Amazon Web Services account ID of the owner of the cluster. This is only required if the cluster is in another Amazon Web Services account. 123 ResourceOwner *string `pulumi:"resourceOwner"` 124 // The subnet group from which Amazon Redshift chooses the subnet to deploy the endpoint. 125 SubnetGroupName *string `pulumi:"subnetGroupName"` 126 // The connection endpoint for connecting to an Amazon Redshift cluster through the proxy. See details below. 127 VpcEndpoints []EndpointAccessVpcEndpoint `pulumi:"vpcEndpoints"` 128 // The security group that defines the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint. 129 VpcSecurityGroupIds []string `pulumi:"vpcSecurityGroupIds"` 130 } 131 132 type EndpointAccessState struct { 133 // The DNS address of the endpoint. 134 Address pulumi.StringPtrInput 135 // The cluster identifier of the cluster to access. 136 ClusterIdentifier pulumi.StringPtrInput 137 // The Redshift-managed VPC endpoint name. 138 EndpointName pulumi.StringPtrInput 139 // The port number on which the cluster accepts incoming connections. 140 Port pulumi.IntPtrInput 141 // The Amazon Web Services account ID of the owner of the cluster. This is only required if the cluster is in another Amazon Web Services account. 142 ResourceOwner pulumi.StringPtrInput 143 // The subnet group from which Amazon Redshift chooses the subnet to deploy the endpoint. 144 SubnetGroupName pulumi.StringPtrInput 145 // The connection endpoint for connecting to an Amazon Redshift cluster through the proxy. See details below. 146 VpcEndpoints EndpointAccessVpcEndpointArrayInput 147 // The security group that defines the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint. 148 VpcSecurityGroupIds pulumi.StringArrayInput 149 } 150 151 func (EndpointAccessState) ElementType() reflect.Type { 152 return reflect.TypeOf((*endpointAccessState)(nil)).Elem() 153 } 154 155 type endpointAccessArgs struct { 156 // The cluster identifier of the cluster to access. 157 ClusterIdentifier string `pulumi:"clusterIdentifier"` 158 // The Redshift-managed VPC endpoint name. 159 EndpointName string `pulumi:"endpointName"` 160 // The Amazon Web Services account ID of the owner of the cluster. This is only required if the cluster is in another Amazon Web Services account. 161 ResourceOwner *string `pulumi:"resourceOwner"` 162 // The subnet group from which Amazon Redshift chooses the subnet to deploy the endpoint. 163 SubnetGroupName string `pulumi:"subnetGroupName"` 164 // The security group that defines the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint. 165 VpcSecurityGroupIds []string `pulumi:"vpcSecurityGroupIds"` 166 } 167 168 // The set of arguments for constructing a EndpointAccess resource. 169 type EndpointAccessArgs struct { 170 // The cluster identifier of the cluster to access. 171 ClusterIdentifier pulumi.StringInput 172 // The Redshift-managed VPC endpoint name. 173 EndpointName pulumi.StringInput 174 // The Amazon Web Services account ID of the owner of the cluster. This is only required if the cluster is in another Amazon Web Services account. 175 ResourceOwner pulumi.StringPtrInput 176 // The subnet group from which Amazon Redshift chooses the subnet to deploy the endpoint. 177 SubnetGroupName pulumi.StringInput 178 // The security group that defines the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint. 179 VpcSecurityGroupIds pulumi.StringArrayInput 180 } 181 182 func (EndpointAccessArgs) ElementType() reflect.Type { 183 return reflect.TypeOf((*endpointAccessArgs)(nil)).Elem() 184 } 185 186 type EndpointAccessInput interface { 187 pulumi.Input 188 189 ToEndpointAccessOutput() EndpointAccessOutput 190 ToEndpointAccessOutputWithContext(ctx context.Context) EndpointAccessOutput 191 } 192 193 func (*EndpointAccess) ElementType() reflect.Type { 194 return reflect.TypeOf((**EndpointAccess)(nil)).Elem() 195 } 196 197 func (i *EndpointAccess) ToEndpointAccessOutput() EndpointAccessOutput { 198 return i.ToEndpointAccessOutputWithContext(context.Background()) 199 } 200 201 func (i *EndpointAccess) ToEndpointAccessOutputWithContext(ctx context.Context) EndpointAccessOutput { 202 return pulumi.ToOutputWithContext(ctx, i).(EndpointAccessOutput) 203 } 204 205 // EndpointAccessArrayInput is an input type that accepts EndpointAccessArray and EndpointAccessArrayOutput values. 206 // You can construct a concrete instance of `EndpointAccessArrayInput` via: 207 // 208 // EndpointAccessArray{ EndpointAccessArgs{...} } 209 type EndpointAccessArrayInput interface { 210 pulumi.Input 211 212 ToEndpointAccessArrayOutput() EndpointAccessArrayOutput 213 ToEndpointAccessArrayOutputWithContext(context.Context) EndpointAccessArrayOutput 214 } 215 216 type EndpointAccessArray []EndpointAccessInput 217 218 func (EndpointAccessArray) ElementType() reflect.Type { 219 return reflect.TypeOf((*[]*EndpointAccess)(nil)).Elem() 220 } 221 222 func (i EndpointAccessArray) ToEndpointAccessArrayOutput() EndpointAccessArrayOutput { 223 return i.ToEndpointAccessArrayOutputWithContext(context.Background()) 224 } 225 226 func (i EndpointAccessArray) ToEndpointAccessArrayOutputWithContext(ctx context.Context) EndpointAccessArrayOutput { 227 return pulumi.ToOutputWithContext(ctx, i).(EndpointAccessArrayOutput) 228 } 229 230 // EndpointAccessMapInput is an input type that accepts EndpointAccessMap and EndpointAccessMapOutput values. 231 // You can construct a concrete instance of `EndpointAccessMapInput` via: 232 // 233 // EndpointAccessMap{ "key": EndpointAccessArgs{...} } 234 type EndpointAccessMapInput interface { 235 pulumi.Input 236 237 ToEndpointAccessMapOutput() EndpointAccessMapOutput 238 ToEndpointAccessMapOutputWithContext(context.Context) EndpointAccessMapOutput 239 } 240 241 type EndpointAccessMap map[string]EndpointAccessInput 242 243 func (EndpointAccessMap) ElementType() reflect.Type { 244 return reflect.TypeOf((*map[string]*EndpointAccess)(nil)).Elem() 245 } 246 247 func (i EndpointAccessMap) ToEndpointAccessMapOutput() EndpointAccessMapOutput { 248 return i.ToEndpointAccessMapOutputWithContext(context.Background()) 249 } 250 251 func (i EndpointAccessMap) ToEndpointAccessMapOutputWithContext(ctx context.Context) EndpointAccessMapOutput { 252 return pulumi.ToOutputWithContext(ctx, i).(EndpointAccessMapOutput) 253 } 254 255 type EndpointAccessOutput struct{ *pulumi.OutputState } 256 257 func (EndpointAccessOutput) ElementType() reflect.Type { 258 return reflect.TypeOf((**EndpointAccess)(nil)).Elem() 259 } 260 261 func (o EndpointAccessOutput) ToEndpointAccessOutput() EndpointAccessOutput { 262 return o 263 } 264 265 func (o EndpointAccessOutput) ToEndpointAccessOutputWithContext(ctx context.Context) EndpointAccessOutput { 266 return o 267 } 268 269 // The DNS address of the endpoint. 270 func (o EndpointAccessOutput) Address() pulumi.StringOutput { 271 return o.ApplyT(func(v *EndpointAccess) pulumi.StringOutput { return v.Address }).(pulumi.StringOutput) 272 } 273 274 // The cluster identifier of the cluster to access. 275 func (o EndpointAccessOutput) ClusterIdentifier() pulumi.StringOutput { 276 return o.ApplyT(func(v *EndpointAccess) pulumi.StringOutput { return v.ClusterIdentifier }).(pulumi.StringOutput) 277 } 278 279 // The Redshift-managed VPC endpoint name. 280 func (o EndpointAccessOutput) EndpointName() pulumi.StringOutput { 281 return o.ApplyT(func(v *EndpointAccess) pulumi.StringOutput { return v.EndpointName }).(pulumi.StringOutput) 282 } 283 284 // The port number on which the cluster accepts incoming connections. 285 func (o EndpointAccessOutput) Port() pulumi.IntOutput { 286 return o.ApplyT(func(v *EndpointAccess) pulumi.IntOutput { return v.Port }).(pulumi.IntOutput) 287 } 288 289 // The Amazon Web Services account ID of the owner of the cluster. This is only required if the cluster is in another Amazon Web Services account. 290 func (o EndpointAccessOutput) ResourceOwner() pulumi.StringOutput { 291 return o.ApplyT(func(v *EndpointAccess) pulumi.StringOutput { return v.ResourceOwner }).(pulumi.StringOutput) 292 } 293 294 // The subnet group from which Amazon Redshift chooses the subnet to deploy the endpoint. 295 func (o EndpointAccessOutput) SubnetGroupName() pulumi.StringOutput { 296 return o.ApplyT(func(v *EndpointAccess) pulumi.StringOutput { return v.SubnetGroupName }).(pulumi.StringOutput) 297 } 298 299 // The connection endpoint for connecting to an Amazon Redshift cluster through the proxy. See details below. 300 func (o EndpointAccessOutput) VpcEndpoints() EndpointAccessVpcEndpointArrayOutput { 301 return o.ApplyT(func(v *EndpointAccess) EndpointAccessVpcEndpointArrayOutput { return v.VpcEndpoints }).(EndpointAccessVpcEndpointArrayOutput) 302 } 303 304 // The security group that defines the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint. 305 func (o EndpointAccessOutput) VpcSecurityGroupIds() pulumi.StringArrayOutput { 306 return o.ApplyT(func(v *EndpointAccess) pulumi.StringArrayOutput { return v.VpcSecurityGroupIds }).(pulumi.StringArrayOutput) 307 } 308 309 type EndpointAccessArrayOutput struct{ *pulumi.OutputState } 310 311 func (EndpointAccessArrayOutput) ElementType() reflect.Type { 312 return reflect.TypeOf((*[]*EndpointAccess)(nil)).Elem() 313 } 314 315 func (o EndpointAccessArrayOutput) ToEndpointAccessArrayOutput() EndpointAccessArrayOutput { 316 return o 317 } 318 319 func (o EndpointAccessArrayOutput) ToEndpointAccessArrayOutputWithContext(ctx context.Context) EndpointAccessArrayOutput { 320 return o 321 } 322 323 func (o EndpointAccessArrayOutput) Index(i pulumi.IntInput) EndpointAccessOutput { 324 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *EndpointAccess { 325 return vs[0].([]*EndpointAccess)[vs[1].(int)] 326 }).(EndpointAccessOutput) 327 } 328 329 type EndpointAccessMapOutput struct{ *pulumi.OutputState } 330 331 func (EndpointAccessMapOutput) ElementType() reflect.Type { 332 return reflect.TypeOf((*map[string]*EndpointAccess)(nil)).Elem() 333 } 334 335 func (o EndpointAccessMapOutput) ToEndpointAccessMapOutput() EndpointAccessMapOutput { 336 return o 337 } 338 339 func (o EndpointAccessMapOutput) ToEndpointAccessMapOutputWithContext(ctx context.Context) EndpointAccessMapOutput { 340 return o 341 } 342 343 func (o EndpointAccessMapOutput) MapIndex(k pulumi.StringInput) EndpointAccessOutput { 344 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *EndpointAccess { 345 return vs[0].(map[string]*EndpointAccess)[vs[1].(string)] 346 }).(EndpointAccessOutput) 347 } 348 349 func init() { 350 pulumi.RegisterInputType(reflect.TypeOf((*EndpointAccessInput)(nil)).Elem(), &EndpointAccess{}) 351 pulumi.RegisterInputType(reflect.TypeOf((*EndpointAccessArrayInput)(nil)).Elem(), EndpointAccessArray{}) 352 pulumi.RegisterInputType(reflect.TypeOf((*EndpointAccessMapInput)(nil)).Elem(), EndpointAccessMap{}) 353 pulumi.RegisterOutputType(EndpointAccessOutput{}) 354 pulumi.RegisterOutputType(EndpointAccessArrayOutput{}) 355 pulumi.RegisterOutputType(EndpointAccessMapOutput{}) 356 }