github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/codeartifact/domain.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 codeartifact 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 a CodeArtifact Domain Resource. 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/codeartifact" 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 := codeartifact.NewDomain(ctx, "example", &codeartifact.DomainArgs{ 33 // Domain: pulumi.String("example"), 34 // }) 35 // if err != nil { 36 // return err 37 // } 38 // return nil 39 // }) 40 // } 41 // 42 // ``` 43 // <!--End PulumiCodeChooser --> 44 // 45 // ## Import 46 // 47 // Using `pulumi import`, import CodeArtifact Domain using the CodeArtifact Domain arn. For example: 48 // 49 // ```sh 50 // $ pulumi import aws:codeartifact/domain:Domain example arn:aws:codeartifact:us-west-2:012345678912:domain/tf-acc-test-8593714120730241305 51 // ``` 52 type Domain struct { 53 pulumi.CustomResourceState 54 55 // The ARN of the Domain. 56 Arn pulumi.StringOutput `pulumi:"arn"` 57 // The total size of all assets in the domain. 58 AssetSizeBytes pulumi.StringOutput `pulumi:"assetSizeBytes"` 59 // A timestamp that represents the date and time the domain was created in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8). 60 CreatedTime pulumi.StringOutput `pulumi:"createdTime"` 61 // The name of the domain to create. All domain names in an AWS Region that are in the same AWS account must be unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a domain name because it is publicly discoverable. 62 Domain pulumi.StringOutput `pulumi:"domain"` 63 // The encryption key for the domain. This is used to encrypt content stored in a domain. The KMS Key Amazon Resource Name (ARN). The default aws/codeartifact AWS KMS master key is used if this element is absent. 64 EncryptionKey pulumi.StringOutput `pulumi:"encryptionKey"` 65 // The AWS account ID that owns the domain. 66 Owner pulumi.StringOutput `pulumi:"owner"` 67 // The number of repositories in the domain. 68 RepositoryCount pulumi.IntOutput `pulumi:"repositoryCount"` 69 // The ARN of the Amazon S3 bucket that is used to store package assets in the domain. 70 S3BucketArn pulumi.StringOutput `pulumi:"s3BucketArn"` 71 // Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 72 Tags pulumi.StringMapOutput `pulumi:"tags"` 73 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 74 // 75 // Deprecated: Please use `tags` instead. 76 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 77 } 78 79 // NewDomain registers a new resource with the given unique name, arguments, and options. 80 func NewDomain(ctx *pulumi.Context, 81 name string, args *DomainArgs, opts ...pulumi.ResourceOption) (*Domain, error) { 82 if args == nil { 83 return nil, errors.New("missing one or more required arguments") 84 } 85 86 if args.Domain == nil { 87 return nil, errors.New("invalid value for required argument 'Domain'") 88 } 89 opts = internal.PkgResourceDefaultOpts(opts) 90 var resource Domain 91 err := ctx.RegisterResource("aws:codeartifact/domain:Domain", name, args, &resource, opts...) 92 if err != nil { 93 return nil, err 94 } 95 return &resource, nil 96 } 97 98 // GetDomain gets an existing Domain resource's state with the given name, ID, and optional 99 // state properties that are used to uniquely qualify the lookup (nil if not required). 100 func GetDomain(ctx *pulumi.Context, 101 name string, id pulumi.IDInput, state *DomainState, opts ...pulumi.ResourceOption) (*Domain, error) { 102 var resource Domain 103 err := ctx.ReadResource("aws:codeartifact/domain:Domain", name, id, state, &resource, opts...) 104 if err != nil { 105 return nil, err 106 } 107 return &resource, nil 108 } 109 110 // Input properties used for looking up and filtering Domain resources. 111 type domainState struct { 112 // The ARN of the Domain. 113 Arn *string `pulumi:"arn"` 114 // The total size of all assets in the domain. 115 AssetSizeBytes *string `pulumi:"assetSizeBytes"` 116 // A timestamp that represents the date and time the domain was created in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8). 117 CreatedTime *string `pulumi:"createdTime"` 118 // The name of the domain to create. All domain names in an AWS Region that are in the same AWS account must be unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a domain name because it is publicly discoverable. 119 Domain *string `pulumi:"domain"` 120 // The encryption key for the domain. This is used to encrypt content stored in a domain. The KMS Key Amazon Resource Name (ARN). The default aws/codeartifact AWS KMS master key is used if this element is absent. 121 EncryptionKey *string `pulumi:"encryptionKey"` 122 // The AWS account ID that owns the domain. 123 Owner *string `pulumi:"owner"` 124 // The number of repositories in the domain. 125 RepositoryCount *int `pulumi:"repositoryCount"` 126 // The ARN of the Amazon S3 bucket that is used to store package assets in the domain. 127 S3BucketArn *string `pulumi:"s3BucketArn"` 128 // Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 129 Tags map[string]string `pulumi:"tags"` 130 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 131 // 132 // Deprecated: Please use `tags` instead. 133 TagsAll map[string]string `pulumi:"tagsAll"` 134 } 135 136 type DomainState struct { 137 // The ARN of the Domain. 138 Arn pulumi.StringPtrInput 139 // The total size of all assets in the domain. 140 AssetSizeBytes pulumi.StringPtrInput 141 // A timestamp that represents the date and time the domain was created in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8). 142 CreatedTime pulumi.StringPtrInput 143 // The name of the domain to create. All domain names in an AWS Region that are in the same AWS account must be unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a domain name because it is publicly discoverable. 144 Domain pulumi.StringPtrInput 145 // The encryption key for the domain. This is used to encrypt content stored in a domain. The KMS Key Amazon Resource Name (ARN). The default aws/codeartifact AWS KMS master key is used if this element is absent. 146 EncryptionKey pulumi.StringPtrInput 147 // The AWS account ID that owns the domain. 148 Owner pulumi.StringPtrInput 149 // The number of repositories in the domain. 150 RepositoryCount pulumi.IntPtrInput 151 // The ARN of the Amazon S3 bucket that is used to store package assets in the domain. 152 S3BucketArn pulumi.StringPtrInput 153 // Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 154 Tags pulumi.StringMapInput 155 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 156 // 157 // Deprecated: Please use `tags` instead. 158 TagsAll pulumi.StringMapInput 159 } 160 161 func (DomainState) ElementType() reflect.Type { 162 return reflect.TypeOf((*domainState)(nil)).Elem() 163 } 164 165 type domainArgs struct { 166 // The name of the domain to create. All domain names in an AWS Region that are in the same AWS account must be unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a domain name because it is publicly discoverable. 167 Domain string `pulumi:"domain"` 168 // The encryption key for the domain. This is used to encrypt content stored in a domain. The KMS Key Amazon Resource Name (ARN). The default aws/codeartifact AWS KMS master key is used if this element is absent. 169 EncryptionKey *string `pulumi:"encryptionKey"` 170 // Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 171 Tags map[string]string `pulumi:"tags"` 172 } 173 174 // The set of arguments for constructing a Domain resource. 175 type DomainArgs struct { 176 // The name of the domain to create. All domain names in an AWS Region that are in the same AWS account must be unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a domain name because it is publicly discoverable. 177 Domain pulumi.StringInput 178 // The encryption key for the domain. This is used to encrypt content stored in a domain. The KMS Key Amazon Resource Name (ARN). The default aws/codeartifact AWS KMS master key is used if this element is absent. 179 EncryptionKey pulumi.StringPtrInput 180 // Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 181 Tags pulumi.StringMapInput 182 } 183 184 func (DomainArgs) ElementType() reflect.Type { 185 return reflect.TypeOf((*domainArgs)(nil)).Elem() 186 } 187 188 type DomainInput interface { 189 pulumi.Input 190 191 ToDomainOutput() DomainOutput 192 ToDomainOutputWithContext(ctx context.Context) DomainOutput 193 } 194 195 func (*Domain) ElementType() reflect.Type { 196 return reflect.TypeOf((**Domain)(nil)).Elem() 197 } 198 199 func (i *Domain) ToDomainOutput() DomainOutput { 200 return i.ToDomainOutputWithContext(context.Background()) 201 } 202 203 func (i *Domain) ToDomainOutputWithContext(ctx context.Context) DomainOutput { 204 return pulumi.ToOutputWithContext(ctx, i).(DomainOutput) 205 } 206 207 // DomainArrayInput is an input type that accepts DomainArray and DomainArrayOutput values. 208 // You can construct a concrete instance of `DomainArrayInput` via: 209 // 210 // DomainArray{ DomainArgs{...} } 211 type DomainArrayInput interface { 212 pulumi.Input 213 214 ToDomainArrayOutput() DomainArrayOutput 215 ToDomainArrayOutputWithContext(context.Context) DomainArrayOutput 216 } 217 218 type DomainArray []DomainInput 219 220 func (DomainArray) ElementType() reflect.Type { 221 return reflect.TypeOf((*[]*Domain)(nil)).Elem() 222 } 223 224 func (i DomainArray) ToDomainArrayOutput() DomainArrayOutput { 225 return i.ToDomainArrayOutputWithContext(context.Background()) 226 } 227 228 func (i DomainArray) ToDomainArrayOutputWithContext(ctx context.Context) DomainArrayOutput { 229 return pulumi.ToOutputWithContext(ctx, i).(DomainArrayOutput) 230 } 231 232 // DomainMapInput is an input type that accepts DomainMap and DomainMapOutput values. 233 // You can construct a concrete instance of `DomainMapInput` via: 234 // 235 // DomainMap{ "key": DomainArgs{...} } 236 type DomainMapInput interface { 237 pulumi.Input 238 239 ToDomainMapOutput() DomainMapOutput 240 ToDomainMapOutputWithContext(context.Context) DomainMapOutput 241 } 242 243 type DomainMap map[string]DomainInput 244 245 func (DomainMap) ElementType() reflect.Type { 246 return reflect.TypeOf((*map[string]*Domain)(nil)).Elem() 247 } 248 249 func (i DomainMap) ToDomainMapOutput() DomainMapOutput { 250 return i.ToDomainMapOutputWithContext(context.Background()) 251 } 252 253 func (i DomainMap) ToDomainMapOutputWithContext(ctx context.Context) DomainMapOutput { 254 return pulumi.ToOutputWithContext(ctx, i).(DomainMapOutput) 255 } 256 257 type DomainOutput struct{ *pulumi.OutputState } 258 259 func (DomainOutput) ElementType() reflect.Type { 260 return reflect.TypeOf((**Domain)(nil)).Elem() 261 } 262 263 func (o DomainOutput) ToDomainOutput() DomainOutput { 264 return o 265 } 266 267 func (o DomainOutput) ToDomainOutputWithContext(ctx context.Context) DomainOutput { 268 return o 269 } 270 271 // The ARN of the Domain. 272 func (o DomainOutput) Arn() pulumi.StringOutput { 273 return o.ApplyT(func(v *Domain) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 274 } 275 276 // The total size of all assets in the domain. 277 func (o DomainOutput) AssetSizeBytes() pulumi.StringOutput { 278 return o.ApplyT(func(v *Domain) pulumi.StringOutput { return v.AssetSizeBytes }).(pulumi.StringOutput) 279 } 280 281 // A timestamp that represents the date and time the domain was created in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8). 282 func (o DomainOutput) CreatedTime() pulumi.StringOutput { 283 return o.ApplyT(func(v *Domain) pulumi.StringOutput { return v.CreatedTime }).(pulumi.StringOutput) 284 } 285 286 // The name of the domain to create. All domain names in an AWS Region that are in the same AWS account must be unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a domain name because it is publicly discoverable. 287 func (o DomainOutput) Domain() pulumi.StringOutput { 288 return o.ApplyT(func(v *Domain) pulumi.StringOutput { return v.Domain }).(pulumi.StringOutput) 289 } 290 291 // The encryption key for the domain. This is used to encrypt content stored in a domain. The KMS Key Amazon Resource Name (ARN). The default aws/codeartifact AWS KMS master key is used if this element is absent. 292 func (o DomainOutput) EncryptionKey() pulumi.StringOutput { 293 return o.ApplyT(func(v *Domain) pulumi.StringOutput { return v.EncryptionKey }).(pulumi.StringOutput) 294 } 295 296 // The AWS account ID that owns the domain. 297 func (o DomainOutput) Owner() pulumi.StringOutput { 298 return o.ApplyT(func(v *Domain) pulumi.StringOutput { return v.Owner }).(pulumi.StringOutput) 299 } 300 301 // The number of repositories in the domain. 302 func (o DomainOutput) RepositoryCount() pulumi.IntOutput { 303 return o.ApplyT(func(v *Domain) pulumi.IntOutput { return v.RepositoryCount }).(pulumi.IntOutput) 304 } 305 306 // The ARN of the Amazon S3 bucket that is used to store package assets in the domain. 307 func (o DomainOutput) S3BucketArn() pulumi.StringOutput { 308 return o.ApplyT(func(v *Domain) pulumi.StringOutput { return v.S3BucketArn }).(pulumi.StringOutput) 309 } 310 311 // Key-value map of resource tags. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 312 func (o DomainOutput) Tags() pulumi.StringMapOutput { 313 return o.ApplyT(func(v *Domain) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 314 } 315 316 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 317 // 318 // Deprecated: Please use `tags` instead. 319 func (o DomainOutput) TagsAll() pulumi.StringMapOutput { 320 return o.ApplyT(func(v *Domain) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 321 } 322 323 type DomainArrayOutput struct{ *pulumi.OutputState } 324 325 func (DomainArrayOutput) ElementType() reflect.Type { 326 return reflect.TypeOf((*[]*Domain)(nil)).Elem() 327 } 328 329 func (o DomainArrayOutput) ToDomainArrayOutput() DomainArrayOutput { 330 return o 331 } 332 333 func (o DomainArrayOutput) ToDomainArrayOutputWithContext(ctx context.Context) DomainArrayOutput { 334 return o 335 } 336 337 func (o DomainArrayOutput) Index(i pulumi.IntInput) DomainOutput { 338 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Domain { 339 return vs[0].([]*Domain)[vs[1].(int)] 340 }).(DomainOutput) 341 } 342 343 type DomainMapOutput struct{ *pulumi.OutputState } 344 345 func (DomainMapOutput) ElementType() reflect.Type { 346 return reflect.TypeOf((*map[string]*Domain)(nil)).Elem() 347 } 348 349 func (o DomainMapOutput) ToDomainMapOutput() DomainMapOutput { 350 return o 351 } 352 353 func (o DomainMapOutput) ToDomainMapOutputWithContext(ctx context.Context) DomainMapOutput { 354 return o 355 } 356 357 func (o DomainMapOutput) MapIndex(k pulumi.StringInput) DomainOutput { 358 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Domain { 359 return vs[0].(map[string]*Domain)[vs[1].(string)] 360 }).(DomainOutput) 361 } 362 363 func init() { 364 pulumi.RegisterInputType(reflect.TypeOf((*DomainInput)(nil)).Elem(), &Domain{}) 365 pulumi.RegisterInputType(reflect.TypeOf((*DomainArrayInput)(nil)).Elem(), DomainArray{}) 366 pulumi.RegisterInputType(reflect.TypeOf((*DomainMapInput)(nil)).Elem(), DomainMap{}) 367 pulumi.RegisterOutputType(DomainOutput{}) 368 pulumi.RegisterOutputType(DomainArrayOutput{}) 369 pulumi.RegisterOutputType(DomainMapOutput{}) 370 }