github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/shield/applicationLayerAutomaticResponse.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 shield 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 // Resource for managing an AWS Shield Application Layer Automatic Response for automatic DDoS mitigation. 16 // 17 // ## Example Usage 18 type ApplicationLayerAutomaticResponse struct { 19 pulumi.CustomResourceState 20 21 // One of `COUNT` or `BLOCK` 22 Action pulumi.StringOutput `pulumi:"action"` 23 // ARN of the resource to protect (Cloudfront Distributions and ALBs only at this time). 24 ResourceArn pulumi.StringOutput `pulumi:"resourceArn"` 25 Timeouts ApplicationLayerAutomaticResponseTimeoutsPtrOutput `pulumi:"timeouts"` 26 } 27 28 // NewApplicationLayerAutomaticResponse registers a new resource with the given unique name, arguments, and options. 29 func NewApplicationLayerAutomaticResponse(ctx *pulumi.Context, 30 name string, args *ApplicationLayerAutomaticResponseArgs, opts ...pulumi.ResourceOption) (*ApplicationLayerAutomaticResponse, error) { 31 if args == nil { 32 return nil, errors.New("missing one or more required arguments") 33 } 34 35 if args.Action == nil { 36 return nil, errors.New("invalid value for required argument 'Action'") 37 } 38 if args.ResourceArn == nil { 39 return nil, errors.New("invalid value for required argument 'ResourceArn'") 40 } 41 opts = internal.PkgResourceDefaultOpts(opts) 42 var resource ApplicationLayerAutomaticResponse 43 err := ctx.RegisterResource("aws:shield/applicationLayerAutomaticResponse:ApplicationLayerAutomaticResponse", name, args, &resource, opts...) 44 if err != nil { 45 return nil, err 46 } 47 return &resource, nil 48 } 49 50 // GetApplicationLayerAutomaticResponse gets an existing ApplicationLayerAutomaticResponse resource's state with the given name, ID, and optional 51 // state properties that are used to uniquely qualify the lookup (nil if not required). 52 func GetApplicationLayerAutomaticResponse(ctx *pulumi.Context, 53 name string, id pulumi.IDInput, state *ApplicationLayerAutomaticResponseState, opts ...pulumi.ResourceOption) (*ApplicationLayerAutomaticResponse, error) { 54 var resource ApplicationLayerAutomaticResponse 55 err := ctx.ReadResource("aws:shield/applicationLayerAutomaticResponse:ApplicationLayerAutomaticResponse", name, id, state, &resource, opts...) 56 if err != nil { 57 return nil, err 58 } 59 return &resource, nil 60 } 61 62 // Input properties used for looking up and filtering ApplicationLayerAutomaticResponse resources. 63 type applicationLayerAutomaticResponseState struct { 64 // One of `COUNT` or `BLOCK` 65 Action *string `pulumi:"action"` 66 // ARN of the resource to protect (Cloudfront Distributions and ALBs only at this time). 67 ResourceArn *string `pulumi:"resourceArn"` 68 Timeouts *ApplicationLayerAutomaticResponseTimeouts `pulumi:"timeouts"` 69 } 70 71 type ApplicationLayerAutomaticResponseState struct { 72 // One of `COUNT` or `BLOCK` 73 Action pulumi.StringPtrInput 74 // ARN of the resource to protect (Cloudfront Distributions and ALBs only at this time). 75 ResourceArn pulumi.StringPtrInput 76 Timeouts ApplicationLayerAutomaticResponseTimeoutsPtrInput 77 } 78 79 func (ApplicationLayerAutomaticResponseState) ElementType() reflect.Type { 80 return reflect.TypeOf((*applicationLayerAutomaticResponseState)(nil)).Elem() 81 } 82 83 type applicationLayerAutomaticResponseArgs struct { 84 // One of `COUNT` or `BLOCK` 85 Action string `pulumi:"action"` 86 // ARN of the resource to protect (Cloudfront Distributions and ALBs only at this time). 87 ResourceArn string `pulumi:"resourceArn"` 88 Timeouts *ApplicationLayerAutomaticResponseTimeouts `pulumi:"timeouts"` 89 } 90 91 // The set of arguments for constructing a ApplicationLayerAutomaticResponse resource. 92 type ApplicationLayerAutomaticResponseArgs struct { 93 // One of `COUNT` or `BLOCK` 94 Action pulumi.StringInput 95 // ARN of the resource to protect (Cloudfront Distributions and ALBs only at this time). 96 ResourceArn pulumi.StringInput 97 Timeouts ApplicationLayerAutomaticResponseTimeoutsPtrInput 98 } 99 100 func (ApplicationLayerAutomaticResponseArgs) ElementType() reflect.Type { 101 return reflect.TypeOf((*applicationLayerAutomaticResponseArgs)(nil)).Elem() 102 } 103 104 type ApplicationLayerAutomaticResponseInput interface { 105 pulumi.Input 106 107 ToApplicationLayerAutomaticResponseOutput() ApplicationLayerAutomaticResponseOutput 108 ToApplicationLayerAutomaticResponseOutputWithContext(ctx context.Context) ApplicationLayerAutomaticResponseOutput 109 } 110 111 func (*ApplicationLayerAutomaticResponse) ElementType() reflect.Type { 112 return reflect.TypeOf((**ApplicationLayerAutomaticResponse)(nil)).Elem() 113 } 114 115 func (i *ApplicationLayerAutomaticResponse) ToApplicationLayerAutomaticResponseOutput() ApplicationLayerAutomaticResponseOutput { 116 return i.ToApplicationLayerAutomaticResponseOutputWithContext(context.Background()) 117 } 118 119 func (i *ApplicationLayerAutomaticResponse) ToApplicationLayerAutomaticResponseOutputWithContext(ctx context.Context) ApplicationLayerAutomaticResponseOutput { 120 return pulumi.ToOutputWithContext(ctx, i).(ApplicationLayerAutomaticResponseOutput) 121 } 122 123 // ApplicationLayerAutomaticResponseArrayInput is an input type that accepts ApplicationLayerAutomaticResponseArray and ApplicationLayerAutomaticResponseArrayOutput values. 124 // You can construct a concrete instance of `ApplicationLayerAutomaticResponseArrayInput` via: 125 // 126 // ApplicationLayerAutomaticResponseArray{ ApplicationLayerAutomaticResponseArgs{...} } 127 type ApplicationLayerAutomaticResponseArrayInput interface { 128 pulumi.Input 129 130 ToApplicationLayerAutomaticResponseArrayOutput() ApplicationLayerAutomaticResponseArrayOutput 131 ToApplicationLayerAutomaticResponseArrayOutputWithContext(context.Context) ApplicationLayerAutomaticResponseArrayOutput 132 } 133 134 type ApplicationLayerAutomaticResponseArray []ApplicationLayerAutomaticResponseInput 135 136 func (ApplicationLayerAutomaticResponseArray) ElementType() reflect.Type { 137 return reflect.TypeOf((*[]*ApplicationLayerAutomaticResponse)(nil)).Elem() 138 } 139 140 func (i ApplicationLayerAutomaticResponseArray) ToApplicationLayerAutomaticResponseArrayOutput() ApplicationLayerAutomaticResponseArrayOutput { 141 return i.ToApplicationLayerAutomaticResponseArrayOutputWithContext(context.Background()) 142 } 143 144 func (i ApplicationLayerAutomaticResponseArray) ToApplicationLayerAutomaticResponseArrayOutputWithContext(ctx context.Context) ApplicationLayerAutomaticResponseArrayOutput { 145 return pulumi.ToOutputWithContext(ctx, i).(ApplicationLayerAutomaticResponseArrayOutput) 146 } 147 148 // ApplicationLayerAutomaticResponseMapInput is an input type that accepts ApplicationLayerAutomaticResponseMap and ApplicationLayerAutomaticResponseMapOutput values. 149 // You can construct a concrete instance of `ApplicationLayerAutomaticResponseMapInput` via: 150 // 151 // ApplicationLayerAutomaticResponseMap{ "key": ApplicationLayerAutomaticResponseArgs{...} } 152 type ApplicationLayerAutomaticResponseMapInput interface { 153 pulumi.Input 154 155 ToApplicationLayerAutomaticResponseMapOutput() ApplicationLayerAutomaticResponseMapOutput 156 ToApplicationLayerAutomaticResponseMapOutputWithContext(context.Context) ApplicationLayerAutomaticResponseMapOutput 157 } 158 159 type ApplicationLayerAutomaticResponseMap map[string]ApplicationLayerAutomaticResponseInput 160 161 func (ApplicationLayerAutomaticResponseMap) ElementType() reflect.Type { 162 return reflect.TypeOf((*map[string]*ApplicationLayerAutomaticResponse)(nil)).Elem() 163 } 164 165 func (i ApplicationLayerAutomaticResponseMap) ToApplicationLayerAutomaticResponseMapOutput() ApplicationLayerAutomaticResponseMapOutput { 166 return i.ToApplicationLayerAutomaticResponseMapOutputWithContext(context.Background()) 167 } 168 169 func (i ApplicationLayerAutomaticResponseMap) ToApplicationLayerAutomaticResponseMapOutputWithContext(ctx context.Context) ApplicationLayerAutomaticResponseMapOutput { 170 return pulumi.ToOutputWithContext(ctx, i).(ApplicationLayerAutomaticResponseMapOutput) 171 } 172 173 type ApplicationLayerAutomaticResponseOutput struct{ *pulumi.OutputState } 174 175 func (ApplicationLayerAutomaticResponseOutput) ElementType() reflect.Type { 176 return reflect.TypeOf((**ApplicationLayerAutomaticResponse)(nil)).Elem() 177 } 178 179 func (o ApplicationLayerAutomaticResponseOutput) ToApplicationLayerAutomaticResponseOutput() ApplicationLayerAutomaticResponseOutput { 180 return o 181 } 182 183 func (o ApplicationLayerAutomaticResponseOutput) ToApplicationLayerAutomaticResponseOutputWithContext(ctx context.Context) ApplicationLayerAutomaticResponseOutput { 184 return o 185 } 186 187 // One of `COUNT` or `BLOCK` 188 func (o ApplicationLayerAutomaticResponseOutput) Action() pulumi.StringOutput { 189 return o.ApplyT(func(v *ApplicationLayerAutomaticResponse) pulumi.StringOutput { return v.Action }).(pulumi.StringOutput) 190 } 191 192 // ARN of the resource to protect (Cloudfront Distributions and ALBs only at this time). 193 func (o ApplicationLayerAutomaticResponseOutput) ResourceArn() pulumi.StringOutput { 194 return o.ApplyT(func(v *ApplicationLayerAutomaticResponse) pulumi.StringOutput { return v.ResourceArn }).(pulumi.StringOutput) 195 } 196 197 func (o ApplicationLayerAutomaticResponseOutput) Timeouts() ApplicationLayerAutomaticResponseTimeoutsPtrOutput { 198 return o.ApplyT(func(v *ApplicationLayerAutomaticResponse) ApplicationLayerAutomaticResponseTimeoutsPtrOutput { 199 return v.Timeouts 200 }).(ApplicationLayerAutomaticResponseTimeoutsPtrOutput) 201 } 202 203 type ApplicationLayerAutomaticResponseArrayOutput struct{ *pulumi.OutputState } 204 205 func (ApplicationLayerAutomaticResponseArrayOutput) ElementType() reflect.Type { 206 return reflect.TypeOf((*[]*ApplicationLayerAutomaticResponse)(nil)).Elem() 207 } 208 209 func (o ApplicationLayerAutomaticResponseArrayOutput) ToApplicationLayerAutomaticResponseArrayOutput() ApplicationLayerAutomaticResponseArrayOutput { 210 return o 211 } 212 213 func (o ApplicationLayerAutomaticResponseArrayOutput) ToApplicationLayerAutomaticResponseArrayOutputWithContext(ctx context.Context) ApplicationLayerAutomaticResponseArrayOutput { 214 return o 215 } 216 217 func (o ApplicationLayerAutomaticResponseArrayOutput) Index(i pulumi.IntInput) ApplicationLayerAutomaticResponseOutput { 218 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ApplicationLayerAutomaticResponse { 219 return vs[0].([]*ApplicationLayerAutomaticResponse)[vs[1].(int)] 220 }).(ApplicationLayerAutomaticResponseOutput) 221 } 222 223 type ApplicationLayerAutomaticResponseMapOutput struct{ *pulumi.OutputState } 224 225 func (ApplicationLayerAutomaticResponseMapOutput) ElementType() reflect.Type { 226 return reflect.TypeOf((*map[string]*ApplicationLayerAutomaticResponse)(nil)).Elem() 227 } 228 229 func (o ApplicationLayerAutomaticResponseMapOutput) ToApplicationLayerAutomaticResponseMapOutput() ApplicationLayerAutomaticResponseMapOutput { 230 return o 231 } 232 233 func (o ApplicationLayerAutomaticResponseMapOutput) ToApplicationLayerAutomaticResponseMapOutputWithContext(ctx context.Context) ApplicationLayerAutomaticResponseMapOutput { 234 return o 235 } 236 237 func (o ApplicationLayerAutomaticResponseMapOutput) MapIndex(k pulumi.StringInput) ApplicationLayerAutomaticResponseOutput { 238 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ApplicationLayerAutomaticResponse { 239 return vs[0].(map[string]*ApplicationLayerAutomaticResponse)[vs[1].(string)] 240 }).(ApplicationLayerAutomaticResponseOutput) 241 } 242 243 func init() { 244 pulumi.RegisterInputType(reflect.TypeOf((*ApplicationLayerAutomaticResponseInput)(nil)).Elem(), &ApplicationLayerAutomaticResponse{}) 245 pulumi.RegisterInputType(reflect.TypeOf((*ApplicationLayerAutomaticResponseArrayInput)(nil)).Elem(), ApplicationLayerAutomaticResponseArray{}) 246 pulumi.RegisterInputType(reflect.TypeOf((*ApplicationLayerAutomaticResponseMapInput)(nil)).Elem(), ApplicationLayerAutomaticResponseMap{}) 247 pulumi.RegisterOutputType(ApplicationLayerAutomaticResponseOutput{}) 248 pulumi.RegisterOutputType(ApplicationLayerAutomaticResponseArrayOutput{}) 249 pulumi.RegisterOutputType(ApplicationLayerAutomaticResponseMapOutput{}) 250 }