github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/vpclattice/accessLogSubscription.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 vpclattice 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 VPC Lattice Service Network or Service Access log subscription. 16 // 17 // ## Example Usage 18 // 19 // ### Basic Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/vpclattice" 28 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 29 // 30 // ) 31 // 32 // func main() { 33 // pulumi.Run(func(ctx *pulumi.Context) error { 34 // _, err := vpclattice.NewAccessLogSubscription(ctx, "example", &vpclattice.AccessLogSubscriptionArgs{ 35 // ResourceIdentifier: pulumi.Any(exampleAwsVpclatticeServiceNetwork.Id), 36 // DestinationArn: pulumi.Any(bucket.Arn), 37 // }) 38 // if err != nil { 39 // return err 40 // } 41 // return nil 42 // }) 43 // } 44 // 45 // ``` 46 // <!--End PulumiCodeChooser --> 47 // 48 // ## Import 49 // 50 // Using `pulumi import`, import VPC Lattice Access Log Subscription using the access log subscription ID. For example: 51 // 52 // ```sh 53 // $ pulumi import aws:vpclattice/accessLogSubscription:AccessLogSubscription example rft-8012925589 54 // ``` 55 type AccessLogSubscription struct { 56 pulumi.CustomResourceState 57 58 // Amazon Resource Name (ARN) of the access log subscription. 59 Arn pulumi.StringOutput `pulumi:"arn"` 60 // Amazon Resource Name (ARN) of the log destination. 61 DestinationArn pulumi.StringOutput `pulumi:"destinationArn"` 62 // Amazon Resource Name (ARN) of the service network or service. 63 ResourceArn pulumi.StringOutput `pulumi:"resourceArn"` 64 // The ID or Amazon Resource Identifier (ARN) of the service network or service. You must use the ARN if the resources specified in the operation are in different accounts. 65 ResourceIdentifier pulumi.StringOutput `pulumi:"resourceIdentifier"` 66 Tags pulumi.StringMapOutput `pulumi:"tags"` 67 // Deprecated: Please use `tags` instead. 68 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 69 } 70 71 // NewAccessLogSubscription registers a new resource with the given unique name, arguments, and options. 72 func NewAccessLogSubscription(ctx *pulumi.Context, 73 name string, args *AccessLogSubscriptionArgs, opts ...pulumi.ResourceOption) (*AccessLogSubscription, error) { 74 if args == nil { 75 return nil, errors.New("missing one or more required arguments") 76 } 77 78 if args.DestinationArn == nil { 79 return nil, errors.New("invalid value for required argument 'DestinationArn'") 80 } 81 if args.ResourceIdentifier == nil { 82 return nil, errors.New("invalid value for required argument 'ResourceIdentifier'") 83 } 84 opts = internal.PkgResourceDefaultOpts(opts) 85 var resource AccessLogSubscription 86 err := ctx.RegisterResource("aws:vpclattice/accessLogSubscription:AccessLogSubscription", name, args, &resource, opts...) 87 if err != nil { 88 return nil, err 89 } 90 return &resource, nil 91 } 92 93 // GetAccessLogSubscription gets an existing AccessLogSubscription resource's state with the given name, ID, and optional 94 // state properties that are used to uniquely qualify the lookup (nil if not required). 95 func GetAccessLogSubscription(ctx *pulumi.Context, 96 name string, id pulumi.IDInput, state *AccessLogSubscriptionState, opts ...pulumi.ResourceOption) (*AccessLogSubscription, error) { 97 var resource AccessLogSubscription 98 err := ctx.ReadResource("aws:vpclattice/accessLogSubscription:AccessLogSubscription", name, id, state, &resource, opts...) 99 if err != nil { 100 return nil, err 101 } 102 return &resource, nil 103 } 104 105 // Input properties used for looking up and filtering AccessLogSubscription resources. 106 type accessLogSubscriptionState struct { 107 // Amazon Resource Name (ARN) of the access log subscription. 108 Arn *string `pulumi:"arn"` 109 // Amazon Resource Name (ARN) of the log destination. 110 DestinationArn *string `pulumi:"destinationArn"` 111 // Amazon Resource Name (ARN) of the service network or service. 112 ResourceArn *string `pulumi:"resourceArn"` 113 // The ID or Amazon Resource Identifier (ARN) of the service network or service. You must use the ARN if the resources specified in the operation are in different accounts. 114 ResourceIdentifier *string `pulumi:"resourceIdentifier"` 115 Tags map[string]string `pulumi:"tags"` 116 // Deprecated: Please use `tags` instead. 117 TagsAll map[string]string `pulumi:"tagsAll"` 118 } 119 120 type AccessLogSubscriptionState struct { 121 // Amazon Resource Name (ARN) of the access log subscription. 122 Arn pulumi.StringPtrInput 123 // Amazon Resource Name (ARN) of the log destination. 124 DestinationArn pulumi.StringPtrInput 125 // Amazon Resource Name (ARN) of the service network or service. 126 ResourceArn pulumi.StringPtrInput 127 // The ID or Amazon Resource Identifier (ARN) of the service network or service. You must use the ARN if the resources specified in the operation are in different accounts. 128 ResourceIdentifier pulumi.StringPtrInput 129 Tags pulumi.StringMapInput 130 // Deprecated: Please use `tags` instead. 131 TagsAll pulumi.StringMapInput 132 } 133 134 func (AccessLogSubscriptionState) ElementType() reflect.Type { 135 return reflect.TypeOf((*accessLogSubscriptionState)(nil)).Elem() 136 } 137 138 type accessLogSubscriptionArgs struct { 139 // Amazon Resource Name (ARN) of the log destination. 140 DestinationArn string `pulumi:"destinationArn"` 141 // The ID or Amazon Resource Identifier (ARN) of the service network or service. You must use the ARN if the resources specified in the operation are in different accounts. 142 ResourceIdentifier string `pulumi:"resourceIdentifier"` 143 Tags map[string]string `pulumi:"tags"` 144 } 145 146 // The set of arguments for constructing a AccessLogSubscription resource. 147 type AccessLogSubscriptionArgs struct { 148 // Amazon Resource Name (ARN) of the log destination. 149 DestinationArn pulumi.StringInput 150 // The ID or Amazon Resource Identifier (ARN) of the service network or service. You must use the ARN if the resources specified in the operation are in different accounts. 151 ResourceIdentifier pulumi.StringInput 152 Tags pulumi.StringMapInput 153 } 154 155 func (AccessLogSubscriptionArgs) ElementType() reflect.Type { 156 return reflect.TypeOf((*accessLogSubscriptionArgs)(nil)).Elem() 157 } 158 159 type AccessLogSubscriptionInput interface { 160 pulumi.Input 161 162 ToAccessLogSubscriptionOutput() AccessLogSubscriptionOutput 163 ToAccessLogSubscriptionOutputWithContext(ctx context.Context) AccessLogSubscriptionOutput 164 } 165 166 func (*AccessLogSubscription) ElementType() reflect.Type { 167 return reflect.TypeOf((**AccessLogSubscription)(nil)).Elem() 168 } 169 170 func (i *AccessLogSubscription) ToAccessLogSubscriptionOutput() AccessLogSubscriptionOutput { 171 return i.ToAccessLogSubscriptionOutputWithContext(context.Background()) 172 } 173 174 func (i *AccessLogSubscription) ToAccessLogSubscriptionOutputWithContext(ctx context.Context) AccessLogSubscriptionOutput { 175 return pulumi.ToOutputWithContext(ctx, i).(AccessLogSubscriptionOutput) 176 } 177 178 // AccessLogSubscriptionArrayInput is an input type that accepts AccessLogSubscriptionArray and AccessLogSubscriptionArrayOutput values. 179 // You can construct a concrete instance of `AccessLogSubscriptionArrayInput` via: 180 // 181 // AccessLogSubscriptionArray{ AccessLogSubscriptionArgs{...} } 182 type AccessLogSubscriptionArrayInput interface { 183 pulumi.Input 184 185 ToAccessLogSubscriptionArrayOutput() AccessLogSubscriptionArrayOutput 186 ToAccessLogSubscriptionArrayOutputWithContext(context.Context) AccessLogSubscriptionArrayOutput 187 } 188 189 type AccessLogSubscriptionArray []AccessLogSubscriptionInput 190 191 func (AccessLogSubscriptionArray) ElementType() reflect.Type { 192 return reflect.TypeOf((*[]*AccessLogSubscription)(nil)).Elem() 193 } 194 195 func (i AccessLogSubscriptionArray) ToAccessLogSubscriptionArrayOutput() AccessLogSubscriptionArrayOutput { 196 return i.ToAccessLogSubscriptionArrayOutputWithContext(context.Background()) 197 } 198 199 func (i AccessLogSubscriptionArray) ToAccessLogSubscriptionArrayOutputWithContext(ctx context.Context) AccessLogSubscriptionArrayOutput { 200 return pulumi.ToOutputWithContext(ctx, i).(AccessLogSubscriptionArrayOutput) 201 } 202 203 // AccessLogSubscriptionMapInput is an input type that accepts AccessLogSubscriptionMap and AccessLogSubscriptionMapOutput values. 204 // You can construct a concrete instance of `AccessLogSubscriptionMapInput` via: 205 // 206 // AccessLogSubscriptionMap{ "key": AccessLogSubscriptionArgs{...} } 207 type AccessLogSubscriptionMapInput interface { 208 pulumi.Input 209 210 ToAccessLogSubscriptionMapOutput() AccessLogSubscriptionMapOutput 211 ToAccessLogSubscriptionMapOutputWithContext(context.Context) AccessLogSubscriptionMapOutput 212 } 213 214 type AccessLogSubscriptionMap map[string]AccessLogSubscriptionInput 215 216 func (AccessLogSubscriptionMap) ElementType() reflect.Type { 217 return reflect.TypeOf((*map[string]*AccessLogSubscription)(nil)).Elem() 218 } 219 220 func (i AccessLogSubscriptionMap) ToAccessLogSubscriptionMapOutput() AccessLogSubscriptionMapOutput { 221 return i.ToAccessLogSubscriptionMapOutputWithContext(context.Background()) 222 } 223 224 func (i AccessLogSubscriptionMap) ToAccessLogSubscriptionMapOutputWithContext(ctx context.Context) AccessLogSubscriptionMapOutput { 225 return pulumi.ToOutputWithContext(ctx, i).(AccessLogSubscriptionMapOutput) 226 } 227 228 type AccessLogSubscriptionOutput struct{ *pulumi.OutputState } 229 230 func (AccessLogSubscriptionOutput) ElementType() reflect.Type { 231 return reflect.TypeOf((**AccessLogSubscription)(nil)).Elem() 232 } 233 234 func (o AccessLogSubscriptionOutput) ToAccessLogSubscriptionOutput() AccessLogSubscriptionOutput { 235 return o 236 } 237 238 func (o AccessLogSubscriptionOutput) ToAccessLogSubscriptionOutputWithContext(ctx context.Context) AccessLogSubscriptionOutput { 239 return o 240 } 241 242 // Amazon Resource Name (ARN) of the access log subscription. 243 func (o AccessLogSubscriptionOutput) Arn() pulumi.StringOutput { 244 return o.ApplyT(func(v *AccessLogSubscription) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 245 } 246 247 // Amazon Resource Name (ARN) of the log destination. 248 func (o AccessLogSubscriptionOutput) DestinationArn() pulumi.StringOutput { 249 return o.ApplyT(func(v *AccessLogSubscription) pulumi.StringOutput { return v.DestinationArn }).(pulumi.StringOutput) 250 } 251 252 // Amazon Resource Name (ARN) of the service network or service. 253 func (o AccessLogSubscriptionOutput) ResourceArn() pulumi.StringOutput { 254 return o.ApplyT(func(v *AccessLogSubscription) pulumi.StringOutput { return v.ResourceArn }).(pulumi.StringOutput) 255 } 256 257 // The ID or Amazon Resource Identifier (ARN) of the service network or service. You must use the ARN if the resources specified in the operation are in different accounts. 258 func (o AccessLogSubscriptionOutput) ResourceIdentifier() pulumi.StringOutput { 259 return o.ApplyT(func(v *AccessLogSubscription) pulumi.StringOutput { return v.ResourceIdentifier }).(pulumi.StringOutput) 260 } 261 262 func (o AccessLogSubscriptionOutput) Tags() pulumi.StringMapOutput { 263 return o.ApplyT(func(v *AccessLogSubscription) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 264 } 265 266 // Deprecated: Please use `tags` instead. 267 func (o AccessLogSubscriptionOutput) TagsAll() pulumi.StringMapOutput { 268 return o.ApplyT(func(v *AccessLogSubscription) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 269 } 270 271 type AccessLogSubscriptionArrayOutput struct{ *pulumi.OutputState } 272 273 func (AccessLogSubscriptionArrayOutput) ElementType() reflect.Type { 274 return reflect.TypeOf((*[]*AccessLogSubscription)(nil)).Elem() 275 } 276 277 func (o AccessLogSubscriptionArrayOutput) ToAccessLogSubscriptionArrayOutput() AccessLogSubscriptionArrayOutput { 278 return o 279 } 280 281 func (o AccessLogSubscriptionArrayOutput) ToAccessLogSubscriptionArrayOutputWithContext(ctx context.Context) AccessLogSubscriptionArrayOutput { 282 return o 283 } 284 285 func (o AccessLogSubscriptionArrayOutput) Index(i pulumi.IntInput) AccessLogSubscriptionOutput { 286 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AccessLogSubscription { 287 return vs[0].([]*AccessLogSubscription)[vs[1].(int)] 288 }).(AccessLogSubscriptionOutput) 289 } 290 291 type AccessLogSubscriptionMapOutput struct{ *pulumi.OutputState } 292 293 func (AccessLogSubscriptionMapOutput) ElementType() reflect.Type { 294 return reflect.TypeOf((*map[string]*AccessLogSubscription)(nil)).Elem() 295 } 296 297 func (o AccessLogSubscriptionMapOutput) ToAccessLogSubscriptionMapOutput() AccessLogSubscriptionMapOutput { 298 return o 299 } 300 301 func (o AccessLogSubscriptionMapOutput) ToAccessLogSubscriptionMapOutputWithContext(ctx context.Context) AccessLogSubscriptionMapOutput { 302 return o 303 } 304 305 func (o AccessLogSubscriptionMapOutput) MapIndex(k pulumi.StringInput) AccessLogSubscriptionOutput { 306 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AccessLogSubscription { 307 return vs[0].(map[string]*AccessLogSubscription)[vs[1].(string)] 308 }).(AccessLogSubscriptionOutput) 309 } 310 311 func init() { 312 pulumi.RegisterInputType(reflect.TypeOf((*AccessLogSubscriptionInput)(nil)).Elem(), &AccessLogSubscription{}) 313 pulumi.RegisterInputType(reflect.TypeOf((*AccessLogSubscriptionArrayInput)(nil)).Elem(), AccessLogSubscriptionArray{}) 314 pulumi.RegisterInputType(reflect.TypeOf((*AccessLogSubscriptionMapInput)(nil)).Elem(), AccessLogSubscriptionMap{}) 315 pulumi.RegisterOutputType(AccessLogSubscriptionOutput{}) 316 pulumi.RegisterOutputType(AccessLogSubscriptionArrayOutput{}) 317 pulumi.RegisterOutputType(AccessLogSubscriptionMapOutput{}) 318 }