github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/networkmanager/site.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 // Creates a site in a global network. 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/networkmanager" 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 := networkmanager.NewGlobalNetwork(ctx, "example", nil) 33 // if err != nil { 34 // return err 35 // } 36 // _, err = networkmanager.NewSite(ctx, "example", &networkmanager.SiteArgs{ 37 // GlobalNetworkId: example.ID(), 38 // }) 39 // if err != nil { 40 // return err 41 // } 42 // return nil 43 // }) 44 // } 45 // 46 // ``` 47 // <!--End PulumiCodeChooser --> 48 // 49 // ## Import 50 // 51 // Using `pulumi import`, import `aws_networkmanager_site` using the site ARN. For example: 52 // 53 // ```sh 54 // $ pulumi import aws:networkmanager/site:Site example arn:aws:networkmanager::123456789012:site/global-network-0d47f6t230mz46dy4/site-444555aaabbb11223 55 // ``` 56 type Site struct { 57 pulumi.CustomResourceState 58 59 // Site Amazon Resource Name (ARN) 60 Arn pulumi.StringOutput `pulumi:"arn"` 61 // Description of the Site. 62 Description pulumi.StringPtrOutput `pulumi:"description"` 63 // The ID of the Global Network to create the site in. 64 GlobalNetworkId pulumi.StringOutput `pulumi:"globalNetworkId"` 65 // The site location as documented below. 66 Location SiteLocationPtrOutput `pulumi:"location"` 67 // Key-value tags for the Site. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 68 Tags pulumi.StringMapOutput `pulumi:"tags"` 69 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 70 // 71 // Deprecated: Please use `tags` instead. 72 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 73 } 74 75 // NewSite registers a new resource with the given unique name, arguments, and options. 76 func NewSite(ctx *pulumi.Context, 77 name string, args *SiteArgs, opts ...pulumi.ResourceOption) (*Site, error) { 78 if args == nil { 79 return nil, errors.New("missing one or more required arguments") 80 } 81 82 if args.GlobalNetworkId == nil { 83 return nil, errors.New("invalid value for required argument 'GlobalNetworkId'") 84 } 85 opts = internal.PkgResourceDefaultOpts(opts) 86 var resource Site 87 err := ctx.RegisterResource("aws:networkmanager/site:Site", name, args, &resource, opts...) 88 if err != nil { 89 return nil, err 90 } 91 return &resource, nil 92 } 93 94 // GetSite gets an existing Site resource's state with the given name, ID, and optional 95 // state properties that are used to uniquely qualify the lookup (nil if not required). 96 func GetSite(ctx *pulumi.Context, 97 name string, id pulumi.IDInput, state *SiteState, opts ...pulumi.ResourceOption) (*Site, error) { 98 var resource Site 99 err := ctx.ReadResource("aws:networkmanager/site:Site", name, id, state, &resource, opts...) 100 if err != nil { 101 return nil, err 102 } 103 return &resource, nil 104 } 105 106 // Input properties used for looking up and filtering Site resources. 107 type siteState struct { 108 // Site Amazon Resource Name (ARN) 109 Arn *string `pulumi:"arn"` 110 // Description of the Site. 111 Description *string `pulumi:"description"` 112 // The ID of the Global Network to create the site in. 113 GlobalNetworkId *string `pulumi:"globalNetworkId"` 114 // The site location as documented below. 115 Location *SiteLocation `pulumi:"location"` 116 // Key-value tags for the Site. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 117 Tags map[string]string `pulumi:"tags"` 118 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 119 // 120 // Deprecated: Please use `tags` instead. 121 TagsAll map[string]string `pulumi:"tagsAll"` 122 } 123 124 type SiteState struct { 125 // Site Amazon Resource Name (ARN) 126 Arn pulumi.StringPtrInput 127 // Description of the Site. 128 Description pulumi.StringPtrInput 129 // The ID of the Global Network to create the site in. 130 GlobalNetworkId pulumi.StringPtrInput 131 // The site location as documented below. 132 Location SiteLocationPtrInput 133 // Key-value tags for the Site. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 134 Tags pulumi.StringMapInput 135 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 136 // 137 // Deprecated: Please use `tags` instead. 138 TagsAll pulumi.StringMapInput 139 } 140 141 func (SiteState) ElementType() reflect.Type { 142 return reflect.TypeOf((*siteState)(nil)).Elem() 143 } 144 145 type siteArgs struct { 146 // Description of the Site. 147 Description *string `pulumi:"description"` 148 // The ID of the Global Network to create the site in. 149 GlobalNetworkId string `pulumi:"globalNetworkId"` 150 // The site location as documented below. 151 Location *SiteLocation `pulumi:"location"` 152 // Key-value tags for the Site. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 153 Tags map[string]string `pulumi:"tags"` 154 } 155 156 // The set of arguments for constructing a Site resource. 157 type SiteArgs struct { 158 // Description of the Site. 159 Description pulumi.StringPtrInput 160 // The ID of the Global Network to create the site in. 161 GlobalNetworkId pulumi.StringInput 162 // The site location as documented below. 163 Location SiteLocationPtrInput 164 // Key-value tags for the Site. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 165 Tags pulumi.StringMapInput 166 } 167 168 func (SiteArgs) ElementType() reflect.Type { 169 return reflect.TypeOf((*siteArgs)(nil)).Elem() 170 } 171 172 type SiteInput interface { 173 pulumi.Input 174 175 ToSiteOutput() SiteOutput 176 ToSiteOutputWithContext(ctx context.Context) SiteOutput 177 } 178 179 func (*Site) ElementType() reflect.Type { 180 return reflect.TypeOf((**Site)(nil)).Elem() 181 } 182 183 func (i *Site) ToSiteOutput() SiteOutput { 184 return i.ToSiteOutputWithContext(context.Background()) 185 } 186 187 func (i *Site) ToSiteOutputWithContext(ctx context.Context) SiteOutput { 188 return pulumi.ToOutputWithContext(ctx, i).(SiteOutput) 189 } 190 191 // SiteArrayInput is an input type that accepts SiteArray and SiteArrayOutput values. 192 // You can construct a concrete instance of `SiteArrayInput` via: 193 // 194 // SiteArray{ SiteArgs{...} } 195 type SiteArrayInput interface { 196 pulumi.Input 197 198 ToSiteArrayOutput() SiteArrayOutput 199 ToSiteArrayOutputWithContext(context.Context) SiteArrayOutput 200 } 201 202 type SiteArray []SiteInput 203 204 func (SiteArray) ElementType() reflect.Type { 205 return reflect.TypeOf((*[]*Site)(nil)).Elem() 206 } 207 208 func (i SiteArray) ToSiteArrayOutput() SiteArrayOutput { 209 return i.ToSiteArrayOutputWithContext(context.Background()) 210 } 211 212 func (i SiteArray) ToSiteArrayOutputWithContext(ctx context.Context) SiteArrayOutput { 213 return pulumi.ToOutputWithContext(ctx, i).(SiteArrayOutput) 214 } 215 216 // SiteMapInput is an input type that accepts SiteMap and SiteMapOutput values. 217 // You can construct a concrete instance of `SiteMapInput` via: 218 // 219 // SiteMap{ "key": SiteArgs{...} } 220 type SiteMapInput interface { 221 pulumi.Input 222 223 ToSiteMapOutput() SiteMapOutput 224 ToSiteMapOutputWithContext(context.Context) SiteMapOutput 225 } 226 227 type SiteMap map[string]SiteInput 228 229 func (SiteMap) ElementType() reflect.Type { 230 return reflect.TypeOf((*map[string]*Site)(nil)).Elem() 231 } 232 233 func (i SiteMap) ToSiteMapOutput() SiteMapOutput { 234 return i.ToSiteMapOutputWithContext(context.Background()) 235 } 236 237 func (i SiteMap) ToSiteMapOutputWithContext(ctx context.Context) SiteMapOutput { 238 return pulumi.ToOutputWithContext(ctx, i).(SiteMapOutput) 239 } 240 241 type SiteOutput struct{ *pulumi.OutputState } 242 243 func (SiteOutput) ElementType() reflect.Type { 244 return reflect.TypeOf((**Site)(nil)).Elem() 245 } 246 247 func (o SiteOutput) ToSiteOutput() SiteOutput { 248 return o 249 } 250 251 func (o SiteOutput) ToSiteOutputWithContext(ctx context.Context) SiteOutput { 252 return o 253 } 254 255 // Site Amazon Resource Name (ARN) 256 func (o SiteOutput) Arn() pulumi.StringOutput { 257 return o.ApplyT(func(v *Site) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 258 } 259 260 // Description of the Site. 261 func (o SiteOutput) Description() pulumi.StringPtrOutput { 262 return o.ApplyT(func(v *Site) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 263 } 264 265 // The ID of the Global Network to create the site in. 266 func (o SiteOutput) GlobalNetworkId() pulumi.StringOutput { 267 return o.ApplyT(func(v *Site) pulumi.StringOutput { return v.GlobalNetworkId }).(pulumi.StringOutput) 268 } 269 270 // The site location as documented below. 271 func (o SiteOutput) Location() SiteLocationPtrOutput { 272 return o.ApplyT(func(v *Site) SiteLocationPtrOutput { return v.Location }).(SiteLocationPtrOutput) 273 } 274 275 // Key-value tags for the Site. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 276 func (o SiteOutput) Tags() pulumi.StringMapOutput { 277 return o.ApplyT(func(v *Site) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 278 } 279 280 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 281 // 282 // Deprecated: Please use `tags` instead. 283 func (o SiteOutput) TagsAll() pulumi.StringMapOutput { 284 return o.ApplyT(func(v *Site) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 285 } 286 287 type SiteArrayOutput struct{ *pulumi.OutputState } 288 289 func (SiteArrayOutput) ElementType() reflect.Type { 290 return reflect.TypeOf((*[]*Site)(nil)).Elem() 291 } 292 293 func (o SiteArrayOutput) ToSiteArrayOutput() SiteArrayOutput { 294 return o 295 } 296 297 func (o SiteArrayOutput) ToSiteArrayOutputWithContext(ctx context.Context) SiteArrayOutput { 298 return o 299 } 300 301 func (o SiteArrayOutput) Index(i pulumi.IntInput) SiteOutput { 302 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Site { 303 return vs[0].([]*Site)[vs[1].(int)] 304 }).(SiteOutput) 305 } 306 307 type SiteMapOutput struct{ *pulumi.OutputState } 308 309 func (SiteMapOutput) ElementType() reflect.Type { 310 return reflect.TypeOf((*map[string]*Site)(nil)).Elem() 311 } 312 313 func (o SiteMapOutput) ToSiteMapOutput() SiteMapOutput { 314 return o 315 } 316 317 func (o SiteMapOutput) ToSiteMapOutputWithContext(ctx context.Context) SiteMapOutput { 318 return o 319 } 320 321 func (o SiteMapOutput) MapIndex(k pulumi.StringInput) SiteOutput { 322 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Site { 323 return vs[0].(map[string]*Site)[vs[1].(string)] 324 }).(SiteOutput) 325 } 326 327 func init() { 328 pulumi.RegisterInputType(reflect.TypeOf((*SiteInput)(nil)).Elem(), &Site{}) 329 pulumi.RegisterInputType(reflect.TypeOf((*SiteArrayInput)(nil)).Elem(), SiteArray{}) 330 pulumi.RegisterInputType(reflect.TypeOf((*SiteMapInput)(nil)).Elem(), SiteMap{}) 331 pulumi.RegisterOutputType(SiteOutput{}) 332 pulumi.RegisterOutputType(SiteArrayOutput{}) 333 pulumi.RegisterOutputType(SiteMapOutput{}) 334 }