github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/rds/proxyDefaultTargetGroup.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 rds 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 a resource to manage an RDS DB proxy default target group resource. 16 // 17 // The `rds.ProxyDefaultTargetGroup` behaves differently from normal resources, in that the provider does not _create_ or _destroy_ this resource, since it implicitly exists as part of an RDS DB Proxy. On the provider resource creation it is automatically imported and on resource destruction, the provider performs no actions in RDS. 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/rds" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // example, err := rds.NewProxy(ctx, "example", &rds.ProxyArgs{ 35 // Name: pulumi.String("example"), 36 // DebugLogging: pulumi.Bool(false), 37 // EngineFamily: pulumi.String("MYSQL"), 38 // IdleClientTimeout: pulumi.Int(1800), 39 // RequireTls: pulumi.Bool(true), 40 // RoleArn: pulumi.Any(exampleAwsIamRole.Arn), 41 // VpcSecurityGroupIds: pulumi.StringArray{ 42 // exampleAwsSecurityGroup.Id, 43 // }, 44 // VpcSubnetIds: pulumi.StringArray{ 45 // exampleAwsSubnet.Id, 46 // }, 47 // Auths: rds.ProxyAuthArray{ 48 // &rds.ProxyAuthArgs{ 49 // AuthScheme: pulumi.String("SECRETS"), 50 // Description: pulumi.String("example"), 51 // IamAuth: pulumi.String("DISABLED"), 52 // SecretArn: pulumi.Any(exampleAwsSecretsmanagerSecret.Arn), 53 // }, 54 // }, 55 // Tags: pulumi.StringMap{ 56 // "Name": pulumi.String("example"), 57 // "Key": pulumi.String("value"), 58 // }, 59 // }) 60 // if err != nil { 61 // return err 62 // } 63 // _, err = rds.NewProxyDefaultTargetGroup(ctx, "example", &rds.ProxyDefaultTargetGroupArgs{ 64 // DbProxyName: example.Name, 65 // ConnectionPoolConfig: &rds.ProxyDefaultTargetGroupConnectionPoolConfigArgs{ 66 // ConnectionBorrowTimeout: pulumi.Int(120), 67 // InitQuery: pulumi.String("SET x=1, y=2"), 68 // MaxConnectionsPercent: pulumi.Int(100), 69 // MaxIdleConnectionsPercent: pulumi.Int(50), 70 // SessionPinningFilters: pulumi.StringArray{ 71 // pulumi.String("EXCLUDE_VARIABLE_SETS"), 72 // }, 73 // }, 74 // }) 75 // if err != nil { 76 // return err 77 // } 78 // return nil 79 // }) 80 // } 81 // 82 // ``` 83 // <!--End PulumiCodeChooser --> 84 // 85 // ## Import 86 // 87 // Using `pulumi import`, import DB proxy default target groups using the `db_proxy_name`. For example: 88 // 89 // ```sh 90 // $ pulumi import aws:rds/proxyDefaultTargetGroup:ProxyDefaultTargetGroup example example 91 // ``` 92 type ProxyDefaultTargetGroup struct { 93 pulumi.CustomResourceState 94 95 // The Amazon Resource Name (ARN) representing the target group. 96 Arn pulumi.StringOutput `pulumi:"arn"` 97 // The settings that determine the size and behavior of the connection pool for the target group. 98 ConnectionPoolConfig ProxyDefaultTargetGroupConnectionPoolConfigOutput `pulumi:"connectionPoolConfig"` 99 // Name of the RDS DB Proxy. 100 DbProxyName pulumi.StringOutput `pulumi:"dbProxyName"` 101 // The name of the default target group. 102 Name pulumi.StringOutput `pulumi:"name"` 103 } 104 105 // NewProxyDefaultTargetGroup registers a new resource with the given unique name, arguments, and options. 106 func NewProxyDefaultTargetGroup(ctx *pulumi.Context, 107 name string, args *ProxyDefaultTargetGroupArgs, opts ...pulumi.ResourceOption) (*ProxyDefaultTargetGroup, error) { 108 if args == nil { 109 return nil, errors.New("missing one or more required arguments") 110 } 111 112 if args.DbProxyName == nil { 113 return nil, errors.New("invalid value for required argument 'DbProxyName'") 114 } 115 opts = internal.PkgResourceDefaultOpts(opts) 116 var resource ProxyDefaultTargetGroup 117 err := ctx.RegisterResource("aws:rds/proxyDefaultTargetGroup:ProxyDefaultTargetGroup", name, args, &resource, opts...) 118 if err != nil { 119 return nil, err 120 } 121 return &resource, nil 122 } 123 124 // GetProxyDefaultTargetGroup gets an existing ProxyDefaultTargetGroup resource's state with the given name, ID, and optional 125 // state properties that are used to uniquely qualify the lookup (nil if not required). 126 func GetProxyDefaultTargetGroup(ctx *pulumi.Context, 127 name string, id pulumi.IDInput, state *ProxyDefaultTargetGroupState, opts ...pulumi.ResourceOption) (*ProxyDefaultTargetGroup, error) { 128 var resource ProxyDefaultTargetGroup 129 err := ctx.ReadResource("aws:rds/proxyDefaultTargetGroup:ProxyDefaultTargetGroup", name, id, state, &resource, opts...) 130 if err != nil { 131 return nil, err 132 } 133 return &resource, nil 134 } 135 136 // Input properties used for looking up and filtering ProxyDefaultTargetGroup resources. 137 type proxyDefaultTargetGroupState struct { 138 // The Amazon Resource Name (ARN) representing the target group. 139 Arn *string `pulumi:"arn"` 140 // The settings that determine the size and behavior of the connection pool for the target group. 141 ConnectionPoolConfig *ProxyDefaultTargetGroupConnectionPoolConfig `pulumi:"connectionPoolConfig"` 142 // Name of the RDS DB Proxy. 143 DbProxyName *string `pulumi:"dbProxyName"` 144 // The name of the default target group. 145 Name *string `pulumi:"name"` 146 } 147 148 type ProxyDefaultTargetGroupState struct { 149 // The Amazon Resource Name (ARN) representing the target group. 150 Arn pulumi.StringPtrInput 151 // The settings that determine the size and behavior of the connection pool for the target group. 152 ConnectionPoolConfig ProxyDefaultTargetGroupConnectionPoolConfigPtrInput 153 // Name of the RDS DB Proxy. 154 DbProxyName pulumi.StringPtrInput 155 // The name of the default target group. 156 Name pulumi.StringPtrInput 157 } 158 159 func (ProxyDefaultTargetGroupState) ElementType() reflect.Type { 160 return reflect.TypeOf((*proxyDefaultTargetGroupState)(nil)).Elem() 161 } 162 163 type proxyDefaultTargetGroupArgs struct { 164 // The settings that determine the size and behavior of the connection pool for the target group. 165 ConnectionPoolConfig *ProxyDefaultTargetGroupConnectionPoolConfig `pulumi:"connectionPoolConfig"` 166 // Name of the RDS DB Proxy. 167 DbProxyName string `pulumi:"dbProxyName"` 168 } 169 170 // The set of arguments for constructing a ProxyDefaultTargetGroup resource. 171 type ProxyDefaultTargetGroupArgs struct { 172 // The settings that determine the size and behavior of the connection pool for the target group. 173 ConnectionPoolConfig ProxyDefaultTargetGroupConnectionPoolConfigPtrInput 174 // Name of the RDS DB Proxy. 175 DbProxyName pulumi.StringInput 176 } 177 178 func (ProxyDefaultTargetGroupArgs) ElementType() reflect.Type { 179 return reflect.TypeOf((*proxyDefaultTargetGroupArgs)(nil)).Elem() 180 } 181 182 type ProxyDefaultTargetGroupInput interface { 183 pulumi.Input 184 185 ToProxyDefaultTargetGroupOutput() ProxyDefaultTargetGroupOutput 186 ToProxyDefaultTargetGroupOutputWithContext(ctx context.Context) ProxyDefaultTargetGroupOutput 187 } 188 189 func (*ProxyDefaultTargetGroup) ElementType() reflect.Type { 190 return reflect.TypeOf((**ProxyDefaultTargetGroup)(nil)).Elem() 191 } 192 193 func (i *ProxyDefaultTargetGroup) ToProxyDefaultTargetGroupOutput() ProxyDefaultTargetGroupOutput { 194 return i.ToProxyDefaultTargetGroupOutputWithContext(context.Background()) 195 } 196 197 func (i *ProxyDefaultTargetGroup) ToProxyDefaultTargetGroupOutputWithContext(ctx context.Context) ProxyDefaultTargetGroupOutput { 198 return pulumi.ToOutputWithContext(ctx, i).(ProxyDefaultTargetGroupOutput) 199 } 200 201 // ProxyDefaultTargetGroupArrayInput is an input type that accepts ProxyDefaultTargetGroupArray and ProxyDefaultTargetGroupArrayOutput values. 202 // You can construct a concrete instance of `ProxyDefaultTargetGroupArrayInput` via: 203 // 204 // ProxyDefaultTargetGroupArray{ ProxyDefaultTargetGroupArgs{...} } 205 type ProxyDefaultTargetGroupArrayInput interface { 206 pulumi.Input 207 208 ToProxyDefaultTargetGroupArrayOutput() ProxyDefaultTargetGroupArrayOutput 209 ToProxyDefaultTargetGroupArrayOutputWithContext(context.Context) ProxyDefaultTargetGroupArrayOutput 210 } 211 212 type ProxyDefaultTargetGroupArray []ProxyDefaultTargetGroupInput 213 214 func (ProxyDefaultTargetGroupArray) ElementType() reflect.Type { 215 return reflect.TypeOf((*[]*ProxyDefaultTargetGroup)(nil)).Elem() 216 } 217 218 func (i ProxyDefaultTargetGroupArray) ToProxyDefaultTargetGroupArrayOutput() ProxyDefaultTargetGroupArrayOutput { 219 return i.ToProxyDefaultTargetGroupArrayOutputWithContext(context.Background()) 220 } 221 222 func (i ProxyDefaultTargetGroupArray) ToProxyDefaultTargetGroupArrayOutputWithContext(ctx context.Context) ProxyDefaultTargetGroupArrayOutput { 223 return pulumi.ToOutputWithContext(ctx, i).(ProxyDefaultTargetGroupArrayOutput) 224 } 225 226 // ProxyDefaultTargetGroupMapInput is an input type that accepts ProxyDefaultTargetGroupMap and ProxyDefaultTargetGroupMapOutput values. 227 // You can construct a concrete instance of `ProxyDefaultTargetGroupMapInput` via: 228 // 229 // ProxyDefaultTargetGroupMap{ "key": ProxyDefaultTargetGroupArgs{...} } 230 type ProxyDefaultTargetGroupMapInput interface { 231 pulumi.Input 232 233 ToProxyDefaultTargetGroupMapOutput() ProxyDefaultTargetGroupMapOutput 234 ToProxyDefaultTargetGroupMapOutputWithContext(context.Context) ProxyDefaultTargetGroupMapOutput 235 } 236 237 type ProxyDefaultTargetGroupMap map[string]ProxyDefaultTargetGroupInput 238 239 func (ProxyDefaultTargetGroupMap) ElementType() reflect.Type { 240 return reflect.TypeOf((*map[string]*ProxyDefaultTargetGroup)(nil)).Elem() 241 } 242 243 func (i ProxyDefaultTargetGroupMap) ToProxyDefaultTargetGroupMapOutput() ProxyDefaultTargetGroupMapOutput { 244 return i.ToProxyDefaultTargetGroupMapOutputWithContext(context.Background()) 245 } 246 247 func (i ProxyDefaultTargetGroupMap) ToProxyDefaultTargetGroupMapOutputWithContext(ctx context.Context) ProxyDefaultTargetGroupMapOutput { 248 return pulumi.ToOutputWithContext(ctx, i).(ProxyDefaultTargetGroupMapOutput) 249 } 250 251 type ProxyDefaultTargetGroupOutput struct{ *pulumi.OutputState } 252 253 func (ProxyDefaultTargetGroupOutput) ElementType() reflect.Type { 254 return reflect.TypeOf((**ProxyDefaultTargetGroup)(nil)).Elem() 255 } 256 257 func (o ProxyDefaultTargetGroupOutput) ToProxyDefaultTargetGroupOutput() ProxyDefaultTargetGroupOutput { 258 return o 259 } 260 261 func (o ProxyDefaultTargetGroupOutput) ToProxyDefaultTargetGroupOutputWithContext(ctx context.Context) ProxyDefaultTargetGroupOutput { 262 return o 263 } 264 265 // The Amazon Resource Name (ARN) representing the target group. 266 func (o ProxyDefaultTargetGroupOutput) Arn() pulumi.StringOutput { 267 return o.ApplyT(func(v *ProxyDefaultTargetGroup) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 268 } 269 270 // The settings that determine the size and behavior of the connection pool for the target group. 271 func (o ProxyDefaultTargetGroupOutput) ConnectionPoolConfig() ProxyDefaultTargetGroupConnectionPoolConfigOutput { 272 return o.ApplyT(func(v *ProxyDefaultTargetGroup) ProxyDefaultTargetGroupConnectionPoolConfigOutput { 273 return v.ConnectionPoolConfig 274 }).(ProxyDefaultTargetGroupConnectionPoolConfigOutput) 275 } 276 277 // Name of the RDS DB Proxy. 278 func (o ProxyDefaultTargetGroupOutput) DbProxyName() pulumi.StringOutput { 279 return o.ApplyT(func(v *ProxyDefaultTargetGroup) pulumi.StringOutput { return v.DbProxyName }).(pulumi.StringOutput) 280 } 281 282 // The name of the default target group. 283 func (o ProxyDefaultTargetGroupOutput) Name() pulumi.StringOutput { 284 return o.ApplyT(func(v *ProxyDefaultTargetGroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 285 } 286 287 type ProxyDefaultTargetGroupArrayOutput struct{ *pulumi.OutputState } 288 289 func (ProxyDefaultTargetGroupArrayOutput) ElementType() reflect.Type { 290 return reflect.TypeOf((*[]*ProxyDefaultTargetGroup)(nil)).Elem() 291 } 292 293 func (o ProxyDefaultTargetGroupArrayOutput) ToProxyDefaultTargetGroupArrayOutput() ProxyDefaultTargetGroupArrayOutput { 294 return o 295 } 296 297 func (o ProxyDefaultTargetGroupArrayOutput) ToProxyDefaultTargetGroupArrayOutputWithContext(ctx context.Context) ProxyDefaultTargetGroupArrayOutput { 298 return o 299 } 300 301 func (o ProxyDefaultTargetGroupArrayOutput) Index(i pulumi.IntInput) ProxyDefaultTargetGroupOutput { 302 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ProxyDefaultTargetGroup { 303 return vs[0].([]*ProxyDefaultTargetGroup)[vs[1].(int)] 304 }).(ProxyDefaultTargetGroupOutput) 305 } 306 307 type ProxyDefaultTargetGroupMapOutput struct{ *pulumi.OutputState } 308 309 func (ProxyDefaultTargetGroupMapOutput) ElementType() reflect.Type { 310 return reflect.TypeOf((*map[string]*ProxyDefaultTargetGroup)(nil)).Elem() 311 } 312 313 func (o ProxyDefaultTargetGroupMapOutput) ToProxyDefaultTargetGroupMapOutput() ProxyDefaultTargetGroupMapOutput { 314 return o 315 } 316 317 func (o ProxyDefaultTargetGroupMapOutput) ToProxyDefaultTargetGroupMapOutputWithContext(ctx context.Context) ProxyDefaultTargetGroupMapOutput { 318 return o 319 } 320 321 func (o ProxyDefaultTargetGroupMapOutput) MapIndex(k pulumi.StringInput) ProxyDefaultTargetGroupOutput { 322 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ProxyDefaultTargetGroup { 323 return vs[0].(map[string]*ProxyDefaultTargetGroup)[vs[1].(string)] 324 }).(ProxyDefaultTargetGroupOutput) 325 } 326 327 func init() { 328 pulumi.RegisterInputType(reflect.TypeOf((*ProxyDefaultTargetGroupInput)(nil)).Elem(), &ProxyDefaultTargetGroup{}) 329 pulumi.RegisterInputType(reflect.TypeOf((*ProxyDefaultTargetGroupArrayInput)(nil)).Elem(), ProxyDefaultTargetGroupArray{}) 330 pulumi.RegisterInputType(reflect.TypeOf((*ProxyDefaultTargetGroupMapInput)(nil)).Elem(), ProxyDefaultTargetGroupMap{}) 331 pulumi.RegisterOutputType(ProxyDefaultTargetGroupOutput{}) 332 pulumi.RegisterOutputType(ProxyDefaultTargetGroupArrayOutput{}) 333 pulumi.RegisterOutputType(ProxyDefaultTargetGroupMapOutput{}) 334 }