github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/codestarconnections/host.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 codestarconnections 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 CodeStar Host. 16 // 17 // > **NOTE:** The `codestarconnections.Host` resource is created in the state `PENDING`. Authentication with the host provider must be completed in the AWS Console. For more information visit [Set up a pending host](https://docs.aws.amazon.com/dtconsole/latest/userguide/connections-host-setup.html). 18 // 19 // ## Example Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/codestarconnections" 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 := codestarconnections.NewHost(ctx, "example", &codestarconnections.HostArgs{ 35 // Name: pulumi.String("example-host"), 36 // ProviderEndpoint: pulumi.String("https://example.com"), 37 // ProviderType: pulumi.String("GitHubEnterpriseServer"), 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 CodeStar Host using the ARN. For example: 52 // 53 // ```sh 54 // $ pulumi import aws:codestarconnections/host:Host example-host arn:aws:codestar-connections:us-west-1:0123456789:host/79d4d357-a2ee-41e4-b350-2fe39ae59448 55 // ``` 56 type Host struct { 57 pulumi.CustomResourceState 58 59 // The CodeStar Host ARN. 60 Arn pulumi.StringOutput `pulumi:"arn"` 61 // The name of the host to be created. The name must be unique in the calling AWS account. 62 Name pulumi.StringOutput `pulumi:"name"` 63 // The endpoint of the infrastructure to be represented by the host after it is created. 64 ProviderEndpoint pulumi.StringOutput `pulumi:"providerEndpoint"` 65 // The name of the external provider where your third-party code repository is configured. 66 ProviderType pulumi.StringOutput `pulumi:"providerType"` 67 // The CodeStar Host status. Possible values are `PENDING`, `AVAILABLE`, `VPC_CONFIG_DELETING`, `VPC_CONFIG_INITIALIZING`, and `VPC_CONFIG_FAILED_INITIALIZATION`. 68 Status pulumi.StringOutput `pulumi:"status"` 69 // The VPC configuration to be provisioned for the host. A VPC must be configured, and the infrastructure to be represented by the host must already be connected to the VPC. 70 VpcConfiguration HostVpcConfigurationPtrOutput `pulumi:"vpcConfiguration"` 71 } 72 73 // NewHost registers a new resource with the given unique name, arguments, and options. 74 func NewHost(ctx *pulumi.Context, 75 name string, args *HostArgs, opts ...pulumi.ResourceOption) (*Host, error) { 76 if args == nil { 77 return nil, errors.New("missing one or more required arguments") 78 } 79 80 if args.ProviderEndpoint == nil { 81 return nil, errors.New("invalid value for required argument 'ProviderEndpoint'") 82 } 83 if args.ProviderType == nil { 84 return nil, errors.New("invalid value for required argument 'ProviderType'") 85 } 86 opts = internal.PkgResourceDefaultOpts(opts) 87 var resource Host 88 err := ctx.RegisterResource("aws:codestarconnections/host:Host", name, args, &resource, opts...) 89 if err != nil { 90 return nil, err 91 } 92 return &resource, nil 93 } 94 95 // GetHost gets an existing Host resource's state with the given name, ID, and optional 96 // state properties that are used to uniquely qualify the lookup (nil if not required). 97 func GetHost(ctx *pulumi.Context, 98 name string, id pulumi.IDInput, state *HostState, opts ...pulumi.ResourceOption) (*Host, error) { 99 var resource Host 100 err := ctx.ReadResource("aws:codestarconnections/host:Host", name, id, state, &resource, opts...) 101 if err != nil { 102 return nil, err 103 } 104 return &resource, nil 105 } 106 107 // Input properties used for looking up and filtering Host resources. 108 type hostState struct { 109 // The CodeStar Host ARN. 110 Arn *string `pulumi:"arn"` 111 // The name of the host to be created. The name must be unique in the calling AWS account. 112 Name *string `pulumi:"name"` 113 // The endpoint of the infrastructure to be represented by the host after it is created. 114 ProviderEndpoint *string `pulumi:"providerEndpoint"` 115 // The name of the external provider where your third-party code repository is configured. 116 ProviderType *string `pulumi:"providerType"` 117 // The CodeStar Host status. Possible values are `PENDING`, `AVAILABLE`, `VPC_CONFIG_DELETING`, `VPC_CONFIG_INITIALIZING`, and `VPC_CONFIG_FAILED_INITIALIZATION`. 118 Status *string `pulumi:"status"` 119 // The VPC configuration to be provisioned for the host. A VPC must be configured, and the infrastructure to be represented by the host must already be connected to the VPC. 120 VpcConfiguration *HostVpcConfiguration `pulumi:"vpcConfiguration"` 121 } 122 123 type HostState struct { 124 // The CodeStar Host ARN. 125 Arn pulumi.StringPtrInput 126 // The name of the host to be created. The name must be unique in the calling AWS account. 127 Name pulumi.StringPtrInput 128 // The endpoint of the infrastructure to be represented by the host after it is created. 129 ProviderEndpoint pulumi.StringPtrInput 130 // The name of the external provider where your third-party code repository is configured. 131 ProviderType pulumi.StringPtrInput 132 // The CodeStar Host status. Possible values are `PENDING`, `AVAILABLE`, `VPC_CONFIG_DELETING`, `VPC_CONFIG_INITIALIZING`, and `VPC_CONFIG_FAILED_INITIALIZATION`. 133 Status pulumi.StringPtrInput 134 // The VPC configuration to be provisioned for the host. A VPC must be configured, and the infrastructure to be represented by the host must already be connected to the VPC. 135 VpcConfiguration HostVpcConfigurationPtrInput 136 } 137 138 func (HostState) ElementType() reflect.Type { 139 return reflect.TypeOf((*hostState)(nil)).Elem() 140 } 141 142 type hostArgs struct { 143 // The name of the host to be created. The name must be unique in the calling AWS account. 144 Name *string `pulumi:"name"` 145 // The endpoint of the infrastructure to be represented by the host after it is created. 146 ProviderEndpoint string `pulumi:"providerEndpoint"` 147 // The name of the external provider where your third-party code repository is configured. 148 ProviderType string `pulumi:"providerType"` 149 // The VPC configuration to be provisioned for the host. A VPC must be configured, and the infrastructure to be represented by the host must already be connected to the VPC. 150 VpcConfiguration *HostVpcConfiguration `pulumi:"vpcConfiguration"` 151 } 152 153 // The set of arguments for constructing a Host resource. 154 type HostArgs struct { 155 // The name of the host to be created. The name must be unique in the calling AWS account. 156 Name pulumi.StringPtrInput 157 // The endpoint of the infrastructure to be represented by the host after it is created. 158 ProviderEndpoint pulumi.StringInput 159 // The name of the external provider where your third-party code repository is configured. 160 ProviderType pulumi.StringInput 161 // The VPC configuration to be provisioned for the host. A VPC must be configured, and the infrastructure to be represented by the host must already be connected to the VPC. 162 VpcConfiguration HostVpcConfigurationPtrInput 163 } 164 165 func (HostArgs) ElementType() reflect.Type { 166 return reflect.TypeOf((*hostArgs)(nil)).Elem() 167 } 168 169 type HostInput interface { 170 pulumi.Input 171 172 ToHostOutput() HostOutput 173 ToHostOutputWithContext(ctx context.Context) HostOutput 174 } 175 176 func (*Host) ElementType() reflect.Type { 177 return reflect.TypeOf((**Host)(nil)).Elem() 178 } 179 180 func (i *Host) ToHostOutput() HostOutput { 181 return i.ToHostOutputWithContext(context.Background()) 182 } 183 184 func (i *Host) ToHostOutputWithContext(ctx context.Context) HostOutput { 185 return pulumi.ToOutputWithContext(ctx, i).(HostOutput) 186 } 187 188 // HostArrayInput is an input type that accepts HostArray and HostArrayOutput values. 189 // You can construct a concrete instance of `HostArrayInput` via: 190 // 191 // HostArray{ HostArgs{...} } 192 type HostArrayInput interface { 193 pulumi.Input 194 195 ToHostArrayOutput() HostArrayOutput 196 ToHostArrayOutputWithContext(context.Context) HostArrayOutput 197 } 198 199 type HostArray []HostInput 200 201 func (HostArray) ElementType() reflect.Type { 202 return reflect.TypeOf((*[]*Host)(nil)).Elem() 203 } 204 205 func (i HostArray) ToHostArrayOutput() HostArrayOutput { 206 return i.ToHostArrayOutputWithContext(context.Background()) 207 } 208 209 func (i HostArray) ToHostArrayOutputWithContext(ctx context.Context) HostArrayOutput { 210 return pulumi.ToOutputWithContext(ctx, i).(HostArrayOutput) 211 } 212 213 // HostMapInput is an input type that accepts HostMap and HostMapOutput values. 214 // You can construct a concrete instance of `HostMapInput` via: 215 // 216 // HostMap{ "key": HostArgs{...} } 217 type HostMapInput interface { 218 pulumi.Input 219 220 ToHostMapOutput() HostMapOutput 221 ToHostMapOutputWithContext(context.Context) HostMapOutput 222 } 223 224 type HostMap map[string]HostInput 225 226 func (HostMap) ElementType() reflect.Type { 227 return reflect.TypeOf((*map[string]*Host)(nil)).Elem() 228 } 229 230 func (i HostMap) ToHostMapOutput() HostMapOutput { 231 return i.ToHostMapOutputWithContext(context.Background()) 232 } 233 234 func (i HostMap) ToHostMapOutputWithContext(ctx context.Context) HostMapOutput { 235 return pulumi.ToOutputWithContext(ctx, i).(HostMapOutput) 236 } 237 238 type HostOutput struct{ *pulumi.OutputState } 239 240 func (HostOutput) ElementType() reflect.Type { 241 return reflect.TypeOf((**Host)(nil)).Elem() 242 } 243 244 func (o HostOutput) ToHostOutput() HostOutput { 245 return o 246 } 247 248 func (o HostOutput) ToHostOutputWithContext(ctx context.Context) HostOutput { 249 return o 250 } 251 252 // The CodeStar Host ARN. 253 func (o HostOutput) Arn() pulumi.StringOutput { 254 return o.ApplyT(func(v *Host) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 255 } 256 257 // The name of the host to be created. The name must be unique in the calling AWS account. 258 func (o HostOutput) Name() pulumi.StringOutput { 259 return o.ApplyT(func(v *Host) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 260 } 261 262 // The endpoint of the infrastructure to be represented by the host after it is created. 263 func (o HostOutput) ProviderEndpoint() pulumi.StringOutput { 264 return o.ApplyT(func(v *Host) pulumi.StringOutput { return v.ProviderEndpoint }).(pulumi.StringOutput) 265 } 266 267 // The name of the external provider where your third-party code repository is configured. 268 func (o HostOutput) ProviderType() pulumi.StringOutput { 269 return o.ApplyT(func(v *Host) pulumi.StringOutput { return v.ProviderType }).(pulumi.StringOutput) 270 } 271 272 // The CodeStar Host status. Possible values are `PENDING`, `AVAILABLE`, `VPC_CONFIG_DELETING`, `VPC_CONFIG_INITIALIZING`, and `VPC_CONFIG_FAILED_INITIALIZATION`. 273 func (o HostOutput) Status() pulumi.StringOutput { 274 return o.ApplyT(func(v *Host) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput) 275 } 276 277 // The VPC configuration to be provisioned for the host. A VPC must be configured, and the infrastructure to be represented by the host must already be connected to the VPC. 278 func (o HostOutput) VpcConfiguration() HostVpcConfigurationPtrOutput { 279 return o.ApplyT(func(v *Host) HostVpcConfigurationPtrOutput { return v.VpcConfiguration }).(HostVpcConfigurationPtrOutput) 280 } 281 282 type HostArrayOutput struct{ *pulumi.OutputState } 283 284 func (HostArrayOutput) ElementType() reflect.Type { 285 return reflect.TypeOf((*[]*Host)(nil)).Elem() 286 } 287 288 func (o HostArrayOutput) ToHostArrayOutput() HostArrayOutput { 289 return o 290 } 291 292 func (o HostArrayOutput) ToHostArrayOutputWithContext(ctx context.Context) HostArrayOutput { 293 return o 294 } 295 296 func (o HostArrayOutput) Index(i pulumi.IntInput) HostOutput { 297 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Host { 298 return vs[0].([]*Host)[vs[1].(int)] 299 }).(HostOutput) 300 } 301 302 type HostMapOutput struct{ *pulumi.OutputState } 303 304 func (HostMapOutput) ElementType() reflect.Type { 305 return reflect.TypeOf((*map[string]*Host)(nil)).Elem() 306 } 307 308 func (o HostMapOutput) ToHostMapOutput() HostMapOutput { 309 return o 310 } 311 312 func (o HostMapOutput) ToHostMapOutputWithContext(ctx context.Context) HostMapOutput { 313 return o 314 } 315 316 func (o HostMapOutput) MapIndex(k pulumi.StringInput) HostOutput { 317 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Host { 318 return vs[0].(map[string]*Host)[vs[1].(string)] 319 }).(HostOutput) 320 } 321 322 func init() { 323 pulumi.RegisterInputType(reflect.TypeOf((*HostInput)(nil)).Elem(), &Host{}) 324 pulumi.RegisterInputType(reflect.TypeOf((*HostArrayInput)(nil)).Elem(), HostArray{}) 325 pulumi.RegisterInputType(reflect.TypeOf((*HostMapInput)(nil)).Elem(), HostMap{}) 326 pulumi.RegisterOutputType(HostOutput{}) 327 pulumi.RegisterOutputType(HostArrayOutput{}) 328 pulumi.RegisterOutputType(HostMapOutput{}) 329 }