github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/appsync/domainName.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 appsync 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 // Provides an AppSync Domain Name. 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/appsync" 26 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 27 // 28 // ) 29 // 30 // func main() { 31 // pulumi.Run(func(ctx *pulumi.Context) error { 32 // _, err := appsync.NewDomainName(ctx, "example", &appsync.DomainNameArgs{ 33 // DomainName: pulumi.String("api.example.com"), 34 // CertificateArn: pulumi.Any(exampleAwsAcmCertificate.Arn), 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_appsync_domain_name` using the AppSync domain name. For example: 49 // 50 // ```sh 51 // $ pulumi import aws:appsync/domainName:DomainName example example.com 52 // ``` 53 type DomainName struct { 54 pulumi.CustomResourceState 55 56 // Domain name that AppSync provides. 57 AppsyncDomainName pulumi.StringOutput `pulumi:"appsyncDomainName"` 58 // ARN of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate. The certifiacte must reside in us-east-1. 59 CertificateArn pulumi.StringOutput `pulumi:"certificateArn"` 60 // A description of the Domain Name. 61 Description pulumi.StringPtrOutput `pulumi:"description"` 62 // Domain name. 63 DomainName pulumi.StringOutput `pulumi:"domainName"` 64 // ID of your Amazon Route 53 hosted zone. 65 HostedZoneId pulumi.StringOutput `pulumi:"hostedZoneId"` 66 } 67 68 // NewDomainName registers a new resource with the given unique name, arguments, and options. 69 func NewDomainName(ctx *pulumi.Context, 70 name string, args *DomainNameArgs, opts ...pulumi.ResourceOption) (*DomainName, error) { 71 if args == nil { 72 return nil, errors.New("missing one or more required arguments") 73 } 74 75 if args.CertificateArn == nil { 76 return nil, errors.New("invalid value for required argument 'CertificateArn'") 77 } 78 if args.DomainName == nil { 79 return nil, errors.New("invalid value for required argument 'DomainName'") 80 } 81 opts = internal.PkgResourceDefaultOpts(opts) 82 var resource DomainName 83 err := ctx.RegisterResource("aws:appsync/domainName:DomainName", name, args, &resource, opts...) 84 if err != nil { 85 return nil, err 86 } 87 return &resource, nil 88 } 89 90 // GetDomainName gets an existing DomainName resource's state with the given name, ID, and optional 91 // state properties that are used to uniquely qualify the lookup (nil if not required). 92 func GetDomainName(ctx *pulumi.Context, 93 name string, id pulumi.IDInput, state *DomainNameState, opts ...pulumi.ResourceOption) (*DomainName, error) { 94 var resource DomainName 95 err := ctx.ReadResource("aws:appsync/domainName:DomainName", name, id, state, &resource, opts...) 96 if err != nil { 97 return nil, err 98 } 99 return &resource, nil 100 } 101 102 // Input properties used for looking up and filtering DomainName resources. 103 type domainNameState struct { 104 // Domain name that AppSync provides. 105 AppsyncDomainName *string `pulumi:"appsyncDomainName"` 106 // ARN of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate. The certifiacte must reside in us-east-1. 107 CertificateArn *string `pulumi:"certificateArn"` 108 // A description of the Domain Name. 109 Description *string `pulumi:"description"` 110 // Domain name. 111 DomainName *string `pulumi:"domainName"` 112 // ID of your Amazon Route 53 hosted zone. 113 HostedZoneId *string `pulumi:"hostedZoneId"` 114 } 115 116 type DomainNameState struct { 117 // Domain name that AppSync provides. 118 AppsyncDomainName pulumi.StringPtrInput 119 // ARN of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate. The certifiacte must reside in us-east-1. 120 CertificateArn pulumi.StringPtrInput 121 // A description of the Domain Name. 122 Description pulumi.StringPtrInput 123 // Domain name. 124 DomainName pulumi.StringPtrInput 125 // ID of your Amazon Route 53 hosted zone. 126 HostedZoneId pulumi.StringPtrInput 127 } 128 129 func (DomainNameState) ElementType() reflect.Type { 130 return reflect.TypeOf((*domainNameState)(nil)).Elem() 131 } 132 133 type domainNameArgs struct { 134 // ARN of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate. The certifiacte must reside in us-east-1. 135 CertificateArn string `pulumi:"certificateArn"` 136 // A description of the Domain Name. 137 Description *string `pulumi:"description"` 138 // Domain name. 139 DomainName string `pulumi:"domainName"` 140 } 141 142 // The set of arguments for constructing a DomainName resource. 143 type DomainNameArgs struct { 144 // ARN of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate. The certifiacte must reside in us-east-1. 145 CertificateArn pulumi.StringInput 146 // A description of the Domain Name. 147 Description pulumi.StringPtrInput 148 // Domain name. 149 DomainName pulumi.StringInput 150 } 151 152 func (DomainNameArgs) ElementType() reflect.Type { 153 return reflect.TypeOf((*domainNameArgs)(nil)).Elem() 154 } 155 156 type DomainNameInput interface { 157 pulumi.Input 158 159 ToDomainNameOutput() DomainNameOutput 160 ToDomainNameOutputWithContext(ctx context.Context) DomainNameOutput 161 } 162 163 func (*DomainName) ElementType() reflect.Type { 164 return reflect.TypeOf((**DomainName)(nil)).Elem() 165 } 166 167 func (i *DomainName) ToDomainNameOutput() DomainNameOutput { 168 return i.ToDomainNameOutputWithContext(context.Background()) 169 } 170 171 func (i *DomainName) ToDomainNameOutputWithContext(ctx context.Context) DomainNameOutput { 172 return pulumi.ToOutputWithContext(ctx, i).(DomainNameOutput) 173 } 174 175 // DomainNameArrayInput is an input type that accepts DomainNameArray and DomainNameArrayOutput values. 176 // You can construct a concrete instance of `DomainNameArrayInput` via: 177 // 178 // DomainNameArray{ DomainNameArgs{...} } 179 type DomainNameArrayInput interface { 180 pulumi.Input 181 182 ToDomainNameArrayOutput() DomainNameArrayOutput 183 ToDomainNameArrayOutputWithContext(context.Context) DomainNameArrayOutput 184 } 185 186 type DomainNameArray []DomainNameInput 187 188 func (DomainNameArray) ElementType() reflect.Type { 189 return reflect.TypeOf((*[]*DomainName)(nil)).Elem() 190 } 191 192 func (i DomainNameArray) ToDomainNameArrayOutput() DomainNameArrayOutput { 193 return i.ToDomainNameArrayOutputWithContext(context.Background()) 194 } 195 196 func (i DomainNameArray) ToDomainNameArrayOutputWithContext(ctx context.Context) DomainNameArrayOutput { 197 return pulumi.ToOutputWithContext(ctx, i).(DomainNameArrayOutput) 198 } 199 200 // DomainNameMapInput is an input type that accepts DomainNameMap and DomainNameMapOutput values. 201 // You can construct a concrete instance of `DomainNameMapInput` via: 202 // 203 // DomainNameMap{ "key": DomainNameArgs{...} } 204 type DomainNameMapInput interface { 205 pulumi.Input 206 207 ToDomainNameMapOutput() DomainNameMapOutput 208 ToDomainNameMapOutputWithContext(context.Context) DomainNameMapOutput 209 } 210 211 type DomainNameMap map[string]DomainNameInput 212 213 func (DomainNameMap) ElementType() reflect.Type { 214 return reflect.TypeOf((*map[string]*DomainName)(nil)).Elem() 215 } 216 217 func (i DomainNameMap) ToDomainNameMapOutput() DomainNameMapOutput { 218 return i.ToDomainNameMapOutputWithContext(context.Background()) 219 } 220 221 func (i DomainNameMap) ToDomainNameMapOutputWithContext(ctx context.Context) DomainNameMapOutput { 222 return pulumi.ToOutputWithContext(ctx, i).(DomainNameMapOutput) 223 } 224 225 type DomainNameOutput struct{ *pulumi.OutputState } 226 227 func (DomainNameOutput) ElementType() reflect.Type { 228 return reflect.TypeOf((**DomainName)(nil)).Elem() 229 } 230 231 func (o DomainNameOutput) ToDomainNameOutput() DomainNameOutput { 232 return o 233 } 234 235 func (o DomainNameOutput) ToDomainNameOutputWithContext(ctx context.Context) DomainNameOutput { 236 return o 237 } 238 239 // Domain name that AppSync provides. 240 func (o DomainNameOutput) AppsyncDomainName() pulumi.StringOutput { 241 return o.ApplyT(func(v *DomainName) pulumi.StringOutput { return v.AppsyncDomainName }).(pulumi.StringOutput) 242 } 243 244 // ARN of the certificate. This can be an Certificate Manager (ACM) certificate or an Identity and Access Management (IAM) server certificate. The certifiacte must reside in us-east-1. 245 func (o DomainNameOutput) CertificateArn() pulumi.StringOutput { 246 return o.ApplyT(func(v *DomainName) pulumi.StringOutput { return v.CertificateArn }).(pulumi.StringOutput) 247 } 248 249 // A description of the Domain Name. 250 func (o DomainNameOutput) Description() pulumi.StringPtrOutput { 251 return o.ApplyT(func(v *DomainName) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 252 } 253 254 // Domain name. 255 func (o DomainNameOutput) DomainName() pulumi.StringOutput { 256 return o.ApplyT(func(v *DomainName) pulumi.StringOutput { return v.DomainName }).(pulumi.StringOutput) 257 } 258 259 // ID of your Amazon Route 53 hosted zone. 260 func (o DomainNameOutput) HostedZoneId() pulumi.StringOutput { 261 return o.ApplyT(func(v *DomainName) pulumi.StringOutput { return v.HostedZoneId }).(pulumi.StringOutput) 262 } 263 264 type DomainNameArrayOutput struct{ *pulumi.OutputState } 265 266 func (DomainNameArrayOutput) ElementType() reflect.Type { 267 return reflect.TypeOf((*[]*DomainName)(nil)).Elem() 268 } 269 270 func (o DomainNameArrayOutput) ToDomainNameArrayOutput() DomainNameArrayOutput { 271 return o 272 } 273 274 func (o DomainNameArrayOutput) ToDomainNameArrayOutputWithContext(ctx context.Context) DomainNameArrayOutput { 275 return o 276 } 277 278 func (o DomainNameArrayOutput) Index(i pulumi.IntInput) DomainNameOutput { 279 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DomainName { 280 return vs[0].([]*DomainName)[vs[1].(int)] 281 }).(DomainNameOutput) 282 } 283 284 type DomainNameMapOutput struct{ *pulumi.OutputState } 285 286 func (DomainNameMapOutput) ElementType() reflect.Type { 287 return reflect.TypeOf((*map[string]*DomainName)(nil)).Elem() 288 } 289 290 func (o DomainNameMapOutput) ToDomainNameMapOutput() DomainNameMapOutput { 291 return o 292 } 293 294 func (o DomainNameMapOutput) ToDomainNameMapOutputWithContext(ctx context.Context) DomainNameMapOutput { 295 return o 296 } 297 298 func (o DomainNameMapOutput) MapIndex(k pulumi.StringInput) DomainNameOutput { 299 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DomainName { 300 return vs[0].(map[string]*DomainName)[vs[1].(string)] 301 }).(DomainNameOutput) 302 } 303 304 func init() { 305 pulumi.RegisterInputType(reflect.TypeOf((*DomainNameInput)(nil)).Elem(), &DomainName{}) 306 pulumi.RegisterInputType(reflect.TypeOf((*DomainNameArrayInput)(nil)).Elem(), DomainNameArray{}) 307 pulumi.RegisterInputType(reflect.TypeOf((*DomainNameMapInput)(nil)).Elem(), DomainNameMap{}) 308 pulumi.RegisterOutputType(DomainNameOutput{}) 309 pulumi.RegisterOutputType(DomainNameArrayOutput{}) 310 pulumi.RegisterOutputType(DomainNameMapOutput{}) 311 }