github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/networkmanager/attachmentAccepter.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 networkmanager 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 Network Manager Attachment Accepter. 16 // 17 // ## Example Usage 18 // 19 // ### Example with VPC attachment 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/networkmanager" 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 := networkmanager.NewAttachmentAccepter(ctx, "test", &networkmanager.AttachmentAccepterArgs{ 35 // AttachmentId: pulumi.Any(vpc.Id), 36 // AttachmentType: pulumi.Any(vpc.AttachmentType), 37 // }) 38 // if err != nil { 39 // return err 40 // } 41 // return nil 42 // }) 43 // } 44 // 45 // ``` 46 // <!--End PulumiCodeChooser --> 47 // 48 // ### Example with site-to-site VPN attachment 49 // 50 // <!--Start PulumiCodeChooser --> 51 // ```go 52 // package main 53 // 54 // import ( 55 // 56 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/networkmanager" 57 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 58 // 59 // ) 60 // 61 // func main() { 62 // pulumi.Run(func(ctx *pulumi.Context) error { 63 // _, err := networkmanager.NewAttachmentAccepter(ctx, "test", &networkmanager.AttachmentAccepterArgs{ 64 // AttachmentId: pulumi.Any(vpn.Id), 65 // AttachmentType: pulumi.Any(vpn.AttachmentType), 66 // }) 67 // if err != nil { 68 // return err 69 // } 70 // return nil 71 // }) 72 // } 73 // 74 // ``` 75 // <!--End PulumiCodeChooser --> 76 type AttachmentAccepter struct { 77 pulumi.CustomResourceState 78 79 // The ID of the attachment. 80 AttachmentId pulumi.StringOutput `pulumi:"attachmentId"` 81 // The policy rule number associated with the attachment. 82 AttachmentPolicyRuleNumber pulumi.IntOutput `pulumi:"attachmentPolicyRuleNumber"` 83 // The type of attachment. Valid values can be found in the [AWS Documentation](https://docs.aws.amazon.com/networkmanager/latest/APIReference/API_ListAttachments.html#API_ListAttachments_RequestSyntax) 84 AttachmentType pulumi.StringOutput `pulumi:"attachmentType"` 85 // The ARN of a core network. 86 CoreNetworkArn pulumi.StringOutput `pulumi:"coreNetworkArn"` 87 // The id of a core network. 88 CoreNetworkId pulumi.StringOutput `pulumi:"coreNetworkId"` 89 // The Region where the edge is located. 90 EdgeLocation pulumi.StringOutput `pulumi:"edgeLocation"` 91 // The ID of the attachment account owner. 92 OwnerAccountId pulumi.StringOutput `pulumi:"ownerAccountId"` 93 // The attachment resource ARN. 94 ResourceArn pulumi.StringOutput `pulumi:"resourceArn"` 95 // The name of the segment attachment. 96 SegmentName pulumi.StringOutput `pulumi:"segmentName"` 97 // The state of the attachment. 98 State pulumi.StringOutput `pulumi:"state"` 99 } 100 101 // NewAttachmentAccepter registers a new resource with the given unique name, arguments, and options. 102 func NewAttachmentAccepter(ctx *pulumi.Context, 103 name string, args *AttachmentAccepterArgs, opts ...pulumi.ResourceOption) (*AttachmentAccepter, error) { 104 if args == nil { 105 return nil, errors.New("missing one or more required arguments") 106 } 107 108 if args.AttachmentId == nil { 109 return nil, errors.New("invalid value for required argument 'AttachmentId'") 110 } 111 if args.AttachmentType == nil { 112 return nil, errors.New("invalid value for required argument 'AttachmentType'") 113 } 114 opts = internal.PkgResourceDefaultOpts(opts) 115 var resource AttachmentAccepter 116 err := ctx.RegisterResource("aws:networkmanager/attachmentAccepter:AttachmentAccepter", name, args, &resource, opts...) 117 if err != nil { 118 return nil, err 119 } 120 return &resource, nil 121 } 122 123 // GetAttachmentAccepter gets an existing AttachmentAccepter resource's state with the given name, ID, and optional 124 // state properties that are used to uniquely qualify the lookup (nil if not required). 125 func GetAttachmentAccepter(ctx *pulumi.Context, 126 name string, id pulumi.IDInput, state *AttachmentAccepterState, opts ...pulumi.ResourceOption) (*AttachmentAccepter, error) { 127 var resource AttachmentAccepter 128 err := ctx.ReadResource("aws:networkmanager/attachmentAccepter:AttachmentAccepter", name, id, state, &resource, opts...) 129 if err != nil { 130 return nil, err 131 } 132 return &resource, nil 133 } 134 135 // Input properties used for looking up and filtering AttachmentAccepter resources. 136 type attachmentAccepterState struct { 137 // The ID of the attachment. 138 AttachmentId *string `pulumi:"attachmentId"` 139 // The policy rule number associated with the attachment. 140 AttachmentPolicyRuleNumber *int `pulumi:"attachmentPolicyRuleNumber"` 141 // The type of attachment. Valid values can be found in the [AWS Documentation](https://docs.aws.amazon.com/networkmanager/latest/APIReference/API_ListAttachments.html#API_ListAttachments_RequestSyntax) 142 AttachmentType *string `pulumi:"attachmentType"` 143 // The ARN of a core network. 144 CoreNetworkArn *string `pulumi:"coreNetworkArn"` 145 // The id of a core network. 146 CoreNetworkId *string `pulumi:"coreNetworkId"` 147 // The Region where the edge is located. 148 EdgeLocation *string `pulumi:"edgeLocation"` 149 // The ID of the attachment account owner. 150 OwnerAccountId *string `pulumi:"ownerAccountId"` 151 // The attachment resource ARN. 152 ResourceArn *string `pulumi:"resourceArn"` 153 // The name of the segment attachment. 154 SegmentName *string `pulumi:"segmentName"` 155 // The state of the attachment. 156 State *string `pulumi:"state"` 157 } 158 159 type AttachmentAccepterState struct { 160 // The ID of the attachment. 161 AttachmentId pulumi.StringPtrInput 162 // The policy rule number associated with the attachment. 163 AttachmentPolicyRuleNumber pulumi.IntPtrInput 164 // The type of attachment. Valid values can be found in the [AWS Documentation](https://docs.aws.amazon.com/networkmanager/latest/APIReference/API_ListAttachments.html#API_ListAttachments_RequestSyntax) 165 AttachmentType pulumi.StringPtrInput 166 // The ARN of a core network. 167 CoreNetworkArn pulumi.StringPtrInput 168 // The id of a core network. 169 CoreNetworkId pulumi.StringPtrInput 170 // The Region where the edge is located. 171 EdgeLocation pulumi.StringPtrInput 172 // The ID of the attachment account owner. 173 OwnerAccountId pulumi.StringPtrInput 174 // The attachment resource ARN. 175 ResourceArn pulumi.StringPtrInput 176 // The name of the segment attachment. 177 SegmentName pulumi.StringPtrInput 178 // The state of the attachment. 179 State pulumi.StringPtrInput 180 } 181 182 func (AttachmentAccepterState) ElementType() reflect.Type { 183 return reflect.TypeOf((*attachmentAccepterState)(nil)).Elem() 184 } 185 186 type attachmentAccepterArgs struct { 187 // The ID of the attachment. 188 AttachmentId string `pulumi:"attachmentId"` 189 // The type of attachment. Valid values can be found in the [AWS Documentation](https://docs.aws.amazon.com/networkmanager/latest/APIReference/API_ListAttachments.html#API_ListAttachments_RequestSyntax) 190 AttachmentType string `pulumi:"attachmentType"` 191 } 192 193 // The set of arguments for constructing a AttachmentAccepter resource. 194 type AttachmentAccepterArgs struct { 195 // The ID of the attachment. 196 AttachmentId pulumi.StringInput 197 // The type of attachment. Valid values can be found in the [AWS Documentation](https://docs.aws.amazon.com/networkmanager/latest/APIReference/API_ListAttachments.html#API_ListAttachments_RequestSyntax) 198 AttachmentType pulumi.StringInput 199 } 200 201 func (AttachmentAccepterArgs) ElementType() reflect.Type { 202 return reflect.TypeOf((*attachmentAccepterArgs)(nil)).Elem() 203 } 204 205 type AttachmentAccepterInput interface { 206 pulumi.Input 207 208 ToAttachmentAccepterOutput() AttachmentAccepterOutput 209 ToAttachmentAccepterOutputWithContext(ctx context.Context) AttachmentAccepterOutput 210 } 211 212 func (*AttachmentAccepter) ElementType() reflect.Type { 213 return reflect.TypeOf((**AttachmentAccepter)(nil)).Elem() 214 } 215 216 func (i *AttachmentAccepter) ToAttachmentAccepterOutput() AttachmentAccepterOutput { 217 return i.ToAttachmentAccepterOutputWithContext(context.Background()) 218 } 219 220 func (i *AttachmentAccepter) ToAttachmentAccepterOutputWithContext(ctx context.Context) AttachmentAccepterOutput { 221 return pulumi.ToOutputWithContext(ctx, i).(AttachmentAccepterOutput) 222 } 223 224 // AttachmentAccepterArrayInput is an input type that accepts AttachmentAccepterArray and AttachmentAccepterArrayOutput values. 225 // You can construct a concrete instance of `AttachmentAccepterArrayInput` via: 226 // 227 // AttachmentAccepterArray{ AttachmentAccepterArgs{...} } 228 type AttachmentAccepterArrayInput interface { 229 pulumi.Input 230 231 ToAttachmentAccepterArrayOutput() AttachmentAccepterArrayOutput 232 ToAttachmentAccepterArrayOutputWithContext(context.Context) AttachmentAccepterArrayOutput 233 } 234 235 type AttachmentAccepterArray []AttachmentAccepterInput 236 237 func (AttachmentAccepterArray) ElementType() reflect.Type { 238 return reflect.TypeOf((*[]*AttachmentAccepter)(nil)).Elem() 239 } 240 241 func (i AttachmentAccepterArray) ToAttachmentAccepterArrayOutput() AttachmentAccepterArrayOutput { 242 return i.ToAttachmentAccepterArrayOutputWithContext(context.Background()) 243 } 244 245 func (i AttachmentAccepterArray) ToAttachmentAccepterArrayOutputWithContext(ctx context.Context) AttachmentAccepterArrayOutput { 246 return pulumi.ToOutputWithContext(ctx, i).(AttachmentAccepterArrayOutput) 247 } 248 249 // AttachmentAccepterMapInput is an input type that accepts AttachmentAccepterMap and AttachmentAccepterMapOutput values. 250 // You can construct a concrete instance of `AttachmentAccepterMapInput` via: 251 // 252 // AttachmentAccepterMap{ "key": AttachmentAccepterArgs{...} } 253 type AttachmentAccepterMapInput interface { 254 pulumi.Input 255 256 ToAttachmentAccepterMapOutput() AttachmentAccepterMapOutput 257 ToAttachmentAccepterMapOutputWithContext(context.Context) AttachmentAccepterMapOutput 258 } 259 260 type AttachmentAccepterMap map[string]AttachmentAccepterInput 261 262 func (AttachmentAccepterMap) ElementType() reflect.Type { 263 return reflect.TypeOf((*map[string]*AttachmentAccepter)(nil)).Elem() 264 } 265 266 func (i AttachmentAccepterMap) ToAttachmentAccepterMapOutput() AttachmentAccepterMapOutput { 267 return i.ToAttachmentAccepterMapOutputWithContext(context.Background()) 268 } 269 270 func (i AttachmentAccepterMap) ToAttachmentAccepterMapOutputWithContext(ctx context.Context) AttachmentAccepterMapOutput { 271 return pulumi.ToOutputWithContext(ctx, i).(AttachmentAccepterMapOutput) 272 } 273 274 type AttachmentAccepterOutput struct{ *pulumi.OutputState } 275 276 func (AttachmentAccepterOutput) ElementType() reflect.Type { 277 return reflect.TypeOf((**AttachmentAccepter)(nil)).Elem() 278 } 279 280 func (o AttachmentAccepterOutput) ToAttachmentAccepterOutput() AttachmentAccepterOutput { 281 return o 282 } 283 284 func (o AttachmentAccepterOutput) ToAttachmentAccepterOutputWithContext(ctx context.Context) AttachmentAccepterOutput { 285 return o 286 } 287 288 // The ID of the attachment. 289 func (o AttachmentAccepterOutput) AttachmentId() pulumi.StringOutput { 290 return o.ApplyT(func(v *AttachmentAccepter) pulumi.StringOutput { return v.AttachmentId }).(pulumi.StringOutput) 291 } 292 293 // The policy rule number associated with the attachment. 294 func (o AttachmentAccepterOutput) AttachmentPolicyRuleNumber() pulumi.IntOutput { 295 return o.ApplyT(func(v *AttachmentAccepter) pulumi.IntOutput { return v.AttachmentPolicyRuleNumber }).(pulumi.IntOutput) 296 } 297 298 // The type of attachment. Valid values can be found in the [AWS Documentation](https://docs.aws.amazon.com/networkmanager/latest/APIReference/API_ListAttachments.html#API_ListAttachments_RequestSyntax) 299 func (o AttachmentAccepterOutput) AttachmentType() pulumi.StringOutput { 300 return o.ApplyT(func(v *AttachmentAccepter) pulumi.StringOutput { return v.AttachmentType }).(pulumi.StringOutput) 301 } 302 303 // The ARN of a core network. 304 func (o AttachmentAccepterOutput) CoreNetworkArn() pulumi.StringOutput { 305 return o.ApplyT(func(v *AttachmentAccepter) pulumi.StringOutput { return v.CoreNetworkArn }).(pulumi.StringOutput) 306 } 307 308 // The id of a core network. 309 func (o AttachmentAccepterOutput) CoreNetworkId() pulumi.StringOutput { 310 return o.ApplyT(func(v *AttachmentAccepter) pulumi.StringOutput { return v.CoreNetworkId }).(pulumi.StringOutput) 311 } 312 313 // The Region where the edge is located. 314 func (o AttachmentAccepterOutput) EdgeLocation() pulumi.StringOutput { 315 return o.ApplyT(func(v *AttachmentAccepter) pulumi.StringOutput { return v.EdgeLocation }).(pulumi.StringOutput) 316 } 317 318 // The ID of the attachment account owner. 319 func (o AttachmentAccepterOutput) OwnerAccountId() pulumi.StringOutput { 320 return o.ApplyT(func(v *AttachmentAccepter) pulumi.StringOutput { return v.OwnerAccountId }).(pulumi.StringOutput) 321 } 322 323 // The attachment resource ARN. 324 func (o AttachmentAccepterOutput) ResourceArn() pulumi.StringOutput { 325 return o.ApplyT(func(v *AttachmentAccepter) pulumi.StringOutput { return v.ResourceArn }).(pulumi.StringOutput) 326 } 327 328 // The name of the segment attachment. 329 func (o AttachmentAccepterOutput) SegmentName() pulumi.StringOutput { 330 return o.ApplyT(func(v *AttachmentAccepter) pulumi.StringOutput { return v.SegmentName }).(pulumi.StringOutput) 331 } 332 333 // The state of the attachment. 334 func (o AttachmentAccepterOutput) State() pulumi.StringOutput { 335 return o.ApplyT(func(v *AttachmentAccepter) pulumi.StringOutput { return v.State }).(pulumi.StringOutput) 336 } 337 338 type AttachmentAccepterArrayOutput struct{ *pulumi.OutputState } 339 340 func (AttachmentAccepterArrayOutput) ElementType() reflect.Type { 341 return reflect.TypeOf((*[]*AttachmentAccepter)(nil)).Elem() 342 } 343 344 func (o AttachmentAccepterArrayOutput) ToAttachmentAccepterArrayOutput() AttachmentAccepterArrayOutput { 345 return o 346 } 347 348 func (o AttachmentAccepterArrayOutput) ToAttachmentAccepterArrayOutputWithContext(ctx context.Context) AttachmentAccepterArrayOutput { 349 return o 350 } 351 352 func (o AttachmentAccepterArrayOutput) Index(i pulumi.IntInput) AttachmentAccepterOutput { 353 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AttachmentAccepter { 354 return vs[0].([]*AttachmentAccepter)[vs[1].(int)] 355 }).(AttachmentAccepterOutput) 356 } 357 358 type AttachmentAccepterMapOutput struct{ *pulumi.OutputState } 359 360 func (AttachmentAccepterMapOutput) ElementType() reflect.Type { 361 return reflect.TypeOf((*map[string]*AttachmentAccepter)(nil)).Elem() 362 } 363 364 func (o AttachmentAccepterMapOutput) ToAttachmentAccepterMapOutput() AttachmentAccepterMapOutput { 365 return o 366 } 367 368 func (o AttachmentAccepterMapOutput) ToAttachmentAccepterMapOutputWithContext(ctx context.Context) AttachmentAccepterMapOutput { 369 return o 370 } 371 372 func (o AttachmentAccepterMapOutput) MapIndex(k pulumi.StringInput) AttachmentAccepterOutput { 373 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AttachmentAccepter { 374 return vs[0].(map[string]*AttachmentAccepter)[vs[1].(string)] 375 }).(AttachmentAccepterOutput) 376 } 377 378 func init() { 379 pulumi.RegisterInputType(reflect.TypeOf((*AttachmentAccepterInput)(nil)).Elem(), &AttachmentAccepter{}) 380 pulumi.RegisterInputType(reflect.TypeOf((*AttachmentAccepterArrayInput)(nil)).Elem(), AttachmentAccepterArray{}) 381 pulumi.RegisterInputType(reflect.TypeOf((*AttachmentAccepterMapInput)(nil)).Elem(), AttachmentAccepterMap{}) 382 pulumi.RegisterOutputType(AttachmentAccepterOutput{}) 383 pulumi.RegisterOutputType(AttachmentAccepterArrayOutput{}) 384 pulumi.RegisterOutputType(AttachmentAccepterMapOutput{}) 385 }