github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/securityhub/actionTarget.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 securityhub 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 Security Hub custom action. 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/securityhub" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // example, err := securityhub.NewAccount(ctx, "example", nil) 33 // if err != nil { 34 // return err 35 // } 36 // _, err = securityhub.NewActionTarget(ctx, "example", &securityhub.ActionTargetArgs{ 37 // Name: pulumi.String("Send notification to chat"), 38 // Identifier: pulumi.String("SendToChat"), 39 // Description: pulumi.String("This is custom action sends selected findings to chat"), 40 // }, pulumi.DependsOn([]pulumi.Resource{ 41 // example, 42 // })) 43 // if err != nil { 44 // return err 45 // } 46 // return nil 47 // }) 48 // } 49 // 50 // ``` 51 // <!--End PulumiCodeChooser --> 52 // 53 // ## Import 54 // 55 // Using `pulumi import`, import Security Hub custom action using the action target ARN. For example: 56 // 57 // ```sh 58 // $ pulumi import aws:securityhub/actionTarget:ActionTarget example arn:aws:securityhub:eu-west-1:312940875350:action/custom/a 59 // ``` 60 type ActionTarget struct { 61 pulumi.CustomResourceState 62 63 // Amazon Resource Name (ARN) of the Security Hub custom action target. 64 Arn pulumi.StringOutput `pulumi:"arn"` 65 // The name of the custom action target. 66 Description pulumi.StringOutput `pulumi:"description"` 67 // The ID for the custom action target. 68 Identifier pulumi.StringOutput `pulumi:"identifier"` 69 // The description for the custom action target. 70 Name pulumi.StringOutput `pulumi:"name"` 71 } 72 73 // NewActionTarget registers a new resource with the given unique name, arguments, and options. 74 func NewActionTarget(ctx *pulumi.Context, 75 name string, args *ActionTargetArgs, opts ...pulumi.ResourceOption) (*ActionTarget, error) { 76 if args == nil { 77 return nil, errors.New("missing one or more required arguments") 78 } 79 80 if args.Description == nil { 81 return nil, errors.New("invalid value for required argument 'Description'") 82 } 83 if args.Identifier == nil { 84 return nil, errors.New("invalid value for required argument 'Identifier'") 85 } 86 opts = internal.PkgResourceDefaultOpts(opts) 87 var resource ActionTarget 88 err := ctx.RegisterResource("aws:securityhub/actionTarget:ActionTarget", name, args, &resource, opts...) 89 if err != nil { 90 return nil, err 91 } 92 return &resource, nil 93 } 94 95 // GetActionTarget gets an existing ActionTarget resource's state with the given name, ID, and optional 96 // state properties that are used to uniquely qualify the lookup (nil if not required). 97 func GetActionTarget(ctx *pulumi.Context, 98 name string, id pulumi.IDInput, state *ActionTargetState, opts ...pulumi.ResourceOption) (*ActionTarget, error) { 99 var resource ActionTarget 100 err := ctx.ReadResource("aws:securityhub/actionTarget:ActionTarget", name, id, state, &resource, opts...) 101 if err != nil { 102 return nil, err 103 } 104 return &resource, nil 105 } 106 107 // Input properties used for looking up and filtering ActionTarget resources. 108 type actionTargetState struct { 109 // Amazon Resource Name (ARN) of the Security Hub custom action target. 110 Arn *string `pulumi:"arn"` 111 // The name of the custom action target. 112 Description *string `pulumi:"description"` 113 // The ID for the custom action target. 114 Identifier *string `pulumi:"identifier"` 115 // The description for the custom action target. 116 Name *string `pulumi:"name"` 117 } 118 119 type ActionTargetState struct { 120 // Amazon Resource Name (ARN) of the Security Hub custom action target. 121 Arn pulumi.StringPtrInput 122 // The name of the custom action target. 123 Description pulumi.StringPtrInput 124 // The ID for the custom action target. 125 Identifier pulumi.StringPtrInput 126 // The description for the custom action target. 127 Name pulumi.StringPtrInput 128 } 129 130 func (ActionTargetState) ElementType() reflect.Type { 131 return reflect.TypeOf((*actionTargetState)(nil)).Elem() 132 } 133 134 type actionTargetArgs struct { 135 // The name of the custom action target. 136 Description string `pulumi:"description"` 137 // The ID for the custom action target. 138 Identifier string `pulumi:"identifier"` 139 // The description for the custom action target. 140 Name *string `pulumi:"name"` 141 } 142 143 // The set of arguments for constructing a ActionTarget resource. 144 type ActionTargetArgs struct { 145 // The name of the custom action target. 146 Description pulumi.StringInput 147 // The ID for the custom action target. 148 Identifier pulumi.StringInput 149 // The description for the custom action target. 150 Name pulumi.StringPtrInput 151 } 152 153 func (ActionTargetArgs) ElementType() reflect.Type { 154 return reflect.TypeOf((*actionTargetArgs)(nil)).Elem() 155 } 156 157 type ActionTargetInput interface { 158 pulumi.Input 159 160 ToActionTargetOutput() ActionTargetOutput 161 ToActionTargetOutputWithContext(ctx context.Context) ActionTargetOutput 162 } 163 164 func (*ActionTarget) ElementType() reflect.Type { 165 return reflect.TypeOf((**ActionTarget)(nil)).Elem() 166 } 167 168 func (i *ActionTarget) ToActionTargetOutput() ActionTargetOutput { 169 return i.ToActionTargetOutputWithContext(context.Background()) 170 } 171 172 func (i *ActionTarget) ToActionTargetOutputWithContext(ctx context.Context) ActionTargetOutput { 173 return pulumi.ToOutputWithContext(ctx, i).(ActionTargetOutput) 174 } 175 176 // ActionTargetArrayInput is an input type that accepts ActionTargetArray and ActionTargetArrayOutput values. 177 // You can construct a concrete instance of `ActionTargetArrayInput` via: 178 // 179 // ActionTargetArray{ ActionTargetArgs{...} } 180 type ActionTargetArrayInput interface { 181 pulumi.Input 182 183 ToActionTargetArrayOutput() ActionTargetArrayOutput 184 ToActionTargetArrayOutputWithContext(context.Context) ActionTargetArrayOutput 185 } 186 187 type ActionTargetArray []ActionTargetInput 188 189 func (ActionTargetArray) ElementType() reflect.Type { 190 return reflect.TypeOf((*[]*ActionTarget)(nil)).Elem() 191 } 192 193 func (i ActionTargetArray) ToActionTargetArrayOutput() ActionTargetArrayOutput { 194 return i.ToActionTargetArrayOutputWithContext(context.Background()) 195 } 196 197 func (i ActionTargetArray) ToActionTargetArrayOutputWithContext(ctx context.Context) ActionTargetArrayOutput { 198 return pulumi.ToOutputWithContext(ctx, i).(ActionTargetArrayOutput) 199 } 200 201 // ActionTargetMapInput is an input type that accepts ActionTargetMap and ActionTargetMapOutput values. 202 // You can construct a concrete instance of `ActionTargetMapInput` via: 203 // 204 // ActionTargetMap{ "key": ActionTargetArgs{...} } 205 type ActionTargetMapInput interface { 206 pulumi.Input 207 208 ToActionTargetMapOutput() ActionTargetMapOutput 209 ToActionTargetMapOutputWithContext(context.Context) ActionTargetMapOutput 210 } 211 212 type ActionTargetMap map[string]ActionTargetInput 213 214 func (ActionTargetMap) ElementType() reflect.Type { 215 return reflect.TypeOf((*map[string]*ActionTarget)(nil)).Elem() 216 } 217 218 func (i ActionTargetMap) ToActionTargetMapOutput() ActionTargetMapOutput { 219 return i.ToActionTargetMapOutputWithContext(context.Background()) 220 } 221 222 func (i ActionTargetMap) ToActionTargetMapOutputWithContext(ctx context.Context) ActionTargetMapOutput { 223 return pulumi.ToOutputWithContext(ctx, i).(ActionTargetMapOutput) 224 } 225 226 type ActionTargetOutput struct{ *pulumi.OutputState } 227 228 func (ActionTargetOutput) ElementType() reflect.Type { 229 return reflect.TypeOf((**ActionTarget)(nil)).Elem() 230 } 231 232 func (o ActionTargetOutput) ToActionTargetOutput() ActionTargetOutput { 233 return o 234 } 235 236 func (o ActionTargetOutput) ToActionTargetOutputWithContext(ctx context.Context) ActionTargetOutput { 237 return o 238 } 239 240 // Amazon Resource Name (ARN) of the Security Hub custom action target. 241 func (o ActionTargetOutput) Arn() pulumi.StringOutput { 242 return o.ApplyT(func(v *ActionTarget) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 243 } 244 245 // The name of the custom action target. 246 func (o ActionTargetOutput) Description() pulumi.StringOutput { 247 return o.ApplyT(func(v *ActionTarget) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput) 248 } 249 250 // The ID for the custom action target. 251 func (o ActionTargetOutput) Identifier() pulumi.StringOutput { 252 return o.ApplyT(func(v *ActionTarget) pulumi.StringOutput { return v.Identifier }).(pulumi.StringOutput) 253 } 254 255 // The description for the custom action target. 256 func (o ActionTargetOutput) Name() pulumi.StringOutput { 257 return o.ApplyT(func(v *ActionTarget) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 258 } 259 260 type ActionTargetArrayOutput struct{ *pulumi.OutputState } 261 262 func (ActionTargetArrayOutput) ElementType() reflect.Type { 263 return reflect.TypeOf((*[]*ActionTarget)(nil)).Elem() 264 } 265 266 func (o ActionTargetArrayOutput) ToActionTargetArrayOutput() ActionTargetArrayOutput { 267 return o 268 } 269 270 func (o ActionTargetArrayOutput) ToActionTargetArrayOutputWithContext(ctx context.Context) ActionTargetArrayOutput { 271 return o 272 } 273 274 func (o ActionTargetArrayOutput) Index(i pulumi.IntInput) ActionTargetOutput { 275 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ActionTarget { 276 return vs[0].([]*ActionTarget)[vs[1].(int)] 277 }).(ActionTargetOutput) 278 } 279 280 type ActionTargetMapOutput struct{ *pulumi.OutputState } 281 282 func (ActionTargetMapOutput) ElementType() reflect.Type { 283 return reflect.TypeOf((*map[string]*ActionTarget)(nil)).Elem() 284 } 285 286 func (o ActionTargetMapOutput) ToActionTargetMapOutput() ActionTargetMapOutput { 287 return o 288 } 289 290 func (o ActionTargetMapOutput) ToActionTargetMapOutputWithContext(ctx context.Context) ActionTargetMapOutput { 291 return o 292 } 293 294 func (o ActionTargetMapOutput) MapIndex(k pulumi.StringInput) ActionTargetOutput { 295 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ActionTarget { 296 return vs[0].(map[string]*ActionTarget)[vs[1].(string)] 297 }).(ActionTargetOutput) 298 } 299 300 func init() { 301 pulumi.RegisterInputType(reflect.TypeOf((*ActionTargetInput)(nil)).Elem(), &ActionTarget{}) 302 pulumi.RegisterInputType(reflect.TypeOf((*ActionTargetArrayInput)(nil)).Elem(), ActionTargetArray{}) 303 pulumi.RegisterInputType(reflect.TypeOf((*ActionTargetMapInput)(nil)).Elem(), ActionTargetMap{}) 304 pulumi.RegisterOutputType(ActionTargetOutput{}) 305 pulumi.RegisterOutputType(ActionTargetArrayOutput{}) 306 pulumi.RegisterOutputType(ActionTargetMapOutput{}) 307 }