github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/detective/graph.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 detective 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Provides a resource to manage an [AWS Detective Graph](https://docs.aws.amazon.com/detective/latest/APIReference/API_CreateGraph.html). As an AWS account may own only one Detective graph per region, provisioning multiple Detective graphs requires a separate provider configuration for each graph. 15 // 16 // ## Example Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/detective" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // _, err := detective.NewGraph(ctx, "example", &detective.GraphArgs{ 32 // Tags: pulumi.StringMap{ 33 // "Name": pulumi.String("example-detective-graph"), 34 // }, 35 // }) 36 // if err != nil { 37 // return err 38 // } 39 // return nil 40 // }) 41 // } 42 // 43 // ``` 44 // <!--End PulumiCodeChooser --> 45 // 46 // ## Import 47 // 48 // Using `pulumi import`, import `aws_detective_graph` using the ARN. For example: 49 // 50 // ```sh 51 // $ pulumi import aws:detective/graph:Graph example arn:aws:detective:us-east-1:123456789101:graph:231684d34gh74g4bae1dbc7bd807d02d 52 // ``` 53 type Graph struct { 54 pulumi.CustomResourceState 55 56 // Date and time, in UTC and extended RFC 3339 format, when the Amazon Detective Graph was created. 57 CreatedTime pulumi.StringOutput `pulumi:"createdTime"` 58 // ARN of the Detective Graph. 59 GraphArn pulumi.StringOutput `pulumi:"graphArn"` 60 // A map of tags to assign to the instance. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 61 Tags pulumi.StringMapOutput `pulumi:"tags"` 62 // Deprecated: Please use `tags` instead. 63 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 64 } 65 66 // NewGraph registers a new resource with the given unique name, arguments, and options. 67 func NewGraph(ctx *pulumi.Context, 68 name string, args *GraphArgs, opts ...pulumi.ResourceOption) (*Graph, error) { 69 if args == nil { 70 args = &GraphArgs{} 71 } 72 73 opts = internal.PkgResourceDefaultOpts(opts) 74 var resource Graph 75 err := ctx.RegisterResource("aws:detective/graph:Graph", name, args, &resource, opts...) 76 if err != nil { 77 return nil, err 78 } 79 return &resource, nil 80 } 81 82 // GetGraph gets an existing Graph resource's state with the given name, ID, and optional 83 // state properties that are used to uniquely qualify the lookup (nil if not required). 84 func GetGraph(ctx *pulumi.Context, 85 name string, id pulumi.IDInput, state *GraphState, opts ...pulumi.ResourceOption) (*Graph, error) { 86 var resource Graph 87 err := ctx.ReadResource("aws:detective/graph:Graph", name, id, state, &resource, opts...) 88 if err != nil { 89 return nil, err 90 } 91 return &resource, nil 92 } 93 94 // Input properties used for looking up and filtering Graph resources. 95 type graphState struct { 96 // Date and time, in UTC and extended RFC 3339 format, when the Amazon Detective Graph was created. 97 CreatedTime *string `pulumi:"createdTime"` 98 // ARN of the Detective Graph. 99 GraphArn *string `pulumi:"graphArn"` 100 // A map of tags to assign to the instance. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 101 Tags map[string]string `pulumi:"tags"` 102 // Deprecated: Please use `tags` instead. 103 TagsAll map[string]string `pulumi:"tagsAll"` 104 } 105 106 type GraphState struct { 107 // Date and time, in UTC and extended RFC 3339 format, when the Amazon Detective Graph was created. 108 CreatedTime pulumi.StringPtrInput 109 // ARN of the Detective Graph. 110 GraphArn pulumi.StringPtrInput 111 // A map of tags to assign to the instance. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 112 Tags pulumi.StringMapInput 113 // Deprecated: Please use `tags` instead. 114 TagsAll pulumi.StringMapInput 115 } 116 117 func (GraphState) ElementType() reflect.Type { 118 return reflect.TypeOf((*graphState)(nil)).Elem() 119 } 120 121 type graphArgs struct { 122 // A map of tags to assign to the instance. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 123 Tags map[string]string `pulumi:"tags"` 124 } 125 126 // The set of arguments for constructing a Graph resource. 127 type GraphArgs struct { 128 // A map of tags to assign to the instance. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 129 Tags pulumi.StringMapInput 130 } 131 132 func (GraphArgs) ElementType() reflect.Type { 133 return reflect.TypeOf((*graphArgs)(nil)).Elem() 134 } 135 136 type GraphInput interface { 137 pulumi.Input 138 139 ToGraphOutput() GraphOutput 140 ToGraphOutputWithContext(ctx context.Context) GraphOutput 141 } 142 143 func (*Graph) ElementType() reflect.Type { 144 return reflect.TypeOf((**Graph)(nil)).Elem() 145 } 146 147 func (i *Graph) ToGraphOutput() GraphOutput { 148 return i.ToGraphOutputWithContext(context.Background()) 149 } 150 151 func (i *Graph) ToGraphOutputWithContext(ctx context.Context) GraphOutput { 152 return pulumi.ToOutputWithContext(ctx, i).(GraphOutput) 153 } 154 155 // GraphArrayInput is an input type that accepts GraphArray and GraphArrayOutput values. 156 // You can construct a concrete instance of `GraphArrayInput` via: 157 // 158 // GraphArray{ GraphArgs{...} } 159 type GraphArrayInput interface { 160 pulumi.Input 161 162 ToGraphArrayOutput() GraphArrayOutput 163 ToGraphArrayOutputWithContext(context.Context) GraphArrayOutput 164 } 165 166 type GraphArray []GraphInput 167 168 func (GraphArray) ElementType() reflect.Type { 169 return reflect.TypeOf((*[]*Graph)(nil)).Elem() 170 } 171 172 func (i GraphArray) ToGraphArrayOutput() GraphArrayOutput { 173 return i.ToGraphArrayOutputWithContext(context.Background()) 174 } 175 176 func (i GraphArray) ToGraphArrayOutputWithContext(ctx context.Context) GraphArrayOutput { 177 return pulumi.ToOutputWithContext(ctx, i).(GraphArrayOutput) 178 } 179 180 // GraphMapInput is an input type that accepts GraphMap and GraphMapOutput values. 181 // You can construct a concrete instance of `GraphMapInput` via: 182 // 183 // GraphMap{ "key": GraphArgs{...} } 184 type GraphMapInput interface { 185 pulumi.Input 186 187 ToGraphMapOutput() GraphMapOutput 188 ToGraphMapOutputWithContext(context.Context) GraphMapOutput 189 } 190 191 type GraphMap map[string]GraphInput 192 193 func (GraphMap) ElementType() reflect.Type { 194 return reflect.TypeOf((*map[string]*Graph)(nil)).Elem() 195 } 196 197 func (i GraphMap) ToGraphMapOutput() GraphMapOutput { 198 return i.ToGraphMapOutputWithContext(context.Background()) 199 } 200 201 func (i GraphMap) ToGraphMapOutputWithContext(ctx context.Context) GraphMapOutput { 202 return pulumi.ToOutputWithContext(ctx, i).(GraphMapOutput) 203 } 204 205 type GraphOutput struct{ *pulumi.OutputState } 206 207 func (GraphOutput) ElementType() reflect.Type { 208 return reflect.TypeOf((**Graph)(nil)).Elem() 209 } 210 211 func (o GraphOutput) ToGraphOutput() GraphOutput { 212 return o 213 } 214 215 func (o GraphOutput) ToGraphOutputWithContext(ctx context.Context) GraphOutput { 216 return o 217 } 218 219 // Date and time, in UTC and extended RFC 3339 format, when the Amazon Detective Graph was created. 220 func (o GraphOutput) CreatedTime() pulumi.StringOutput { 221 return o.ApplyT(func(v *Graph) pulumi.StringOutput { return v.CreatedTime }).(pulumi.StringOutput) 222 } 223 224 // ARN of the Detective Graph. 225 func (o GraphOutput) GraphArn() pulumi.StringOutput { 226 return o.ApplyT(func(v *Graph) pulumi.StringOutput { return v.GraphArn }).(pulumi.StringOutput) 227 } 228 229 // A map of tags to assign to the instance. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 230 func (o GraphOutput) Tags() pulumi.StringMapOutput { 231 return o.ApplyT(func(v *Graph) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 232 } 233 234 // Deprecated: Please use `tags` instead. 235 func (o GraphOutput) TagsAll() pulumi.StringMapOutput { 236 return o.ApplyT(func(v *Graph) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 237 } 238 239 type GraphArrayOutput struct{ *pulumi.OutputState } 240 241 func (GraphArrayOutput) ElementType() reflect.Type { 242 return reflect.TypeOf((*[]*Graph)(nil)).Elem() 243 } 244 245 func (o GraphArrayOutput) ToGraphArrayOutput() GraphArrayOutput { 246 return o 247 } 248 249 func (o GraphArrayOutput) ToGraphArrayOutputWithContext(ctx context.Context) GraphArrayOutput { 250 return o 251 } 252 253 func (o GraphArrayOutput) Index(i pulumi.IntInput) GraphOutput { 254 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Graph { 255 return vs[0].([]*Graph)[vs[1].(int)] 256 }).(GraphOutput) 257 } 258 259 type GraphMapOutput struct{ *pulumi.OutputState } 260 261 func (GraphMapOutput) ElementType() reflect.Type { 262 return reflect.TypeOf((*map[string]*Graph)(nil)).Elem() 263 } 264 265 func (o GraphMapOutput) ToGraphMapOutput() GraphMapOutput { 266 return o 267 } 268 269 func (o GraphMapOutput) ToGraphMapOutputWithContext(ctx context.Context) GraphMapOutput { 270 return o 271 } 272 273 func (o GraphMapOutput) MapIndex(k pulumi.StringInput) GraphOutput { 274 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Graph { 275 return vs[0].(map[string]*Graph)[vs[1].(string)] 276 }).(GraphOutput) 277 } 278 279 func init() { 280 pulumi.RegisterInputType(reflect.TypeOf((*GraphInput)(nil)).Elem(), &Graph{}) 281 pulumi.RegisterInputType(reflect.TypeOf((*GraphArrayInput)(nil)).Elem(), GraphArray{}) 282 pulumi.RegisterInputType(reflect.TypeOf((*GraphMapInput)(nil)).Elem(), GraphMap{}) 283 pulumi.RegisterOutputType(GraphOutput{}) 284 pulumi.RegisterOutputType(GraphArrayOutput{}) 285 pulumi.RegisterOutputType(GraphMapOutput{}) 286 }