github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/codecatalyst/project.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 codecatalyst 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 CodeCatalyst Project. 16 // 17 // ## Example Usage 18 // 19 // ### Basic Usage 20 // 21 // <!--Start PulumiCodeChooser --> 22 // ```go 23 // package main 24 // 25 // import ( 26 // 27 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/codecatalyst" 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 := codecatalyst.NewProject(ctx, "test", &codecatalyst.ProjectArgs{ 35 // SpaceName: pulumi.String("myproject"), 36 // DisplayName: pulumi.String("MyProject"), 37 // Description: pulumi.String("My CodeCatalyst Project created using Pulumi"), 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 CodeCatalyst Project using the `id`. For example: 52 // 53 // ```sh 54 // $ pulumi import aws:codecatalyst/project:Project example project-id-12345678 55 // ``` 56 type Project struct { 57 pulumi.CustomResourceState 58 59 // The description of the project. This description will be displayed to all users of the project. We recommend providing a brief description of the project and its intended purpose. 60 Description pulumi.StringPtrOutput `pulumi:"description"` 61 // The friendly name of the project that will be displayed to users. 62 // 63 // The following arguments are optional: 64 DisplayName pulumi.StringOutput `pulumi:"displayName"` 65 // The name of the project in the space. 66 Name pulumi.StringOutput `pulumi:"name"` 67 // The name of the space. 68 SpaceName pulumi.StringOutput `pulumi:"spaceName"` 69 } 70 71 // NewProject registers a new resource with the given unique name, arguments, and options. 72 func NewProject(ctx *pulumi.Context, 73 name string, args *ProjectArgs, opts ...pulumi.ResourceOption) (*Project, error) { 74 if args == nil { 75 return nil, errors.New("missing one or more required arguments") 76 } 77 78 if args.DisplayName == nil { 79 return nil, errors.New("invalid value for required argument 'DisplayName'") 80 } 81 if args.SpaceName == nil { 82 return nil, errors.New("invalid value for required argument 'SpaceName'") 83 } 84 opts = internal.PkgResourceDefaultOpts(opts) 85 var resource Project 86 err := ctx.RegisterResource("aws:codecatalyst/project:Project", name, args, &resource, opts...) 87 if err != nil { 88 return nil, err 89 } 90 return &resource, nil 91 } 92 93 // GetProject gets an existing Project resource's state with the given name, ID, and optional 94 // state properties that are used to uniquely qualify the lookup (nil if not required). 95 func GetProject(ctx *pulumi.Context, 96 name string, id pulumi.IDInput, state *ProjectState, opts ...pulumi.ResourceOption) (*Project, error) { 97 var resource Project 98 err := ctx.ReadResource("aws:codecatalyst/project:Project", name, id, state, &resource, opts...) 99 if err != nil { 100 return nil, err 101 } 102 return &resource, nil 103 } 104 105 // Input properties used for looking up and filtering Project resources. 106 type projectState struct { 107 // The description of the project. This description will be displayed to all users of the project. We recommend providing a brief description of the project and its intended purpose. 108 Description *string `pulumi:"description"` 109 // The friendly name of the project that will be displayed to users. 110 // 111 // The following arguments are optional: 112 DisplayName *string `pulumi:"displayName"` 113 // The name of the project in the space. 114 Name *string `pulumi:"name"` 115 // The name of the space. 116 SpaceName *string `pulumi:"spaceName"` 117 } 118 119 type ProjectState struct { 120 // The description of the project. This description will be displayed to all users of the project. We recommend providing a brief description of the project and its intended purpose. 121 Description pulumi.StringPtrInput 122 // The friendly name of the project that will be displayed to users. 123 // 124 // The following arguments are optional: 125 DisplayName pulumi.StringPtrInput 126 // The name of the project in the space. 127 Name pulumi.StringPtrInput 128 // The name of the space. 129 SpaceName pulumi.StringPtrInput 130 } 131 132 func (ProjectState) ElementType() reflect.Type { 133 return reflect.TypeOf((*projectState)(nil)).Elem() 134 } 135 136 type projectArgs struct { 137 // The description of the project. This description will be displayed to all users of the project. We recommend providing a brief description of the project and its intended purpose. 138 Description *string `pulumi:"description"` 139 // The friendly name of the project that will be displayed to users. 140 // 141 // The following arguments are optional: 142 DisplayName string `pulumi:"displayName"` 143 // The name of the space. 144 SpaceName string `pulumi:"spaceName"` 145 } 146 147 // The set of arguments for constructing a Project resource. 148 type ProjectArgs struct { 149 // The description of the project. This description will be displayed to all users of the project. We recommend providing a brief description of the project and its intended purpose. 150 Description pulumi.StringPtrInput 151 // The friendly name of the project that will be displayed to users. 152 // 153 // The following arguments are optional: 154 DisplayName pulumi.StringInput 155 // The name of the space. 156 SpaceName pulumi.StringInput 157 } 158 159 func (ProjectArgs) ElementType() reflect.Type { 160 return reflect.TypeOf((*projectArgs)(nil)).Elem() 161 } 162 163 type ProjectInput interface { 164 pulumi.Input 165 166 ToProjectOutput() ProjectOutput 167 ToProjectOutputWithContext(ctx context.Context) ProjectOutput 168 } 169 170 func (*Project) ElementType() reflect.Type { 171 return reflect.TypeOf((**Project)(nil)).Elem() 172 } 173 174 func (i *Project) ToProjectOutput() ProjectOutput { 175 return i.ToProjectOutputWithContext(context.Background()) 176 } 177 178 func (i *Project) ToProjectOutputWithContext(ctx context.Context) ProjectOutput { 179 return pulumi.ToOutputWithContext(ctx, i).(ProjectOutput) 180 } 181 182 // ProjectArrayInput is an input type that accepts ProjectArray and ProjectArrayOutput values. 183 // You can construct a concrete instance of `ProjectArrayInput` via: 184 // 185 // ProjectArray{ ProjectArgs{...} } 186 type ProjectArrayInput interface { 187 pulumi.Input 188 189 ToProjectArrayOutput() ProjectArrayOutput 190 ToProjectArrayOutputWithContext(context.Context) ProjectArrayOutput 191 } 192 193 type ProjectArray []ProjectInput 194 195 func (ProjectArray) ElementType() reflect.Type { 196 return reflect.TypeOf((*[]*Project)(nil)).Elem() 197 } 198 199 func (i ProjectArray) ToProjectArrayOutput() ProjectArrayOutput { 200 return i.ToProjectArrayOutputWithContext(context.Background()) 201 } 202 203 func (i ProjectArray) ToProjectArrayOutputWithContext(ctx context.Context) ProjectArrayOutput { 204 return pulumi.ToOutputWithContext(ctx, i).(ProjectArrayOutput) 205 } 206 207 // ProjectMapInput is an input type that accepts ProjectMap and ProjectMapOutput values. 208 // You can construct a concrete instance of `ProjectMapInput` via: 209 // 210 // ProjectMap{ "key": ProjectArgs{...} } 211 type ProjectMapInput interface { 212 pulumi.Input 213 214 ToProjectMapOutput() ProjectMapOutput 215 ToProjectMapOutputWithContext(context.Context) ProjectMapOutput 216 } 217 218 type ProjectMap map[string]ProjectInput 219 220 func (ProjectMap) ElementType() reflect.Type { 221 return reflect.TypeOf((*map[string]*Project)(nil)).Elem() 222 } 223 224 func (i ProjectMap) ToProjectMapOutput() ProjectMapOutput { 225 return i.ToProjectMapOutputWithContext(context.Background()) 226 } 227 228 func (i ProjectMap) ToProjectMapOutputWithContext(ctx context.Context) ProjectMapOutput { 229 return pulumi.ToOutputWithContext(ctx, i).(ProjectMapOutput) 230 } 231 232 type ProjectOutput struct{ *pulumi.OutputState } 233 234 func (ProjectOutput) ElementType() reflect.Type { 235 return reflect.TypeOf((**Project)(nil)).Elem() 236 } 237 238 func (o ProjectOutput) ToProjectOutput() ProjectOutput { 239 return o 240 } 241 242 func (o ProjectOutput) ToProjectOutputWithContext(ctx context.Context) ProjectOutput { 243 return o 244 } 245 246 // The description of the project. This description will be displayed to all users of the project. We recommend providing a brief description of the project and its intended purpose. 247 func (o ProjectOutput) Description() pulumi.StringPtrOutput { 248 return o.ApplyT(func(v *Project) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 249 } 250 251 // The friendly name of the project that will be displayed to users. 252 // 253 // The following arguments are optional: 254 func (o ProjectOutput) DisplayName() pulumi.StringOutput { 255 return o.ApplyT(func(v *Project) pulumi.StringOutput { return v.DisplayName }).(pulumi.StringOutput) 256 } 257 258 // The name of the project in the space. 259 func (o ProjectOutput) Name() pulumi.StringOutput { 260 return o.ApplyT(func(v *Project) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 261 } 262 263 // The name of the space. 264 func (o ProjectOutput) SpaceName() pulumi.StringOutput { 265 return o.ApplyT(func(v *Project) pulumi.StringOutput { return v.SpaceName }).(pulumi.StringOutput) 266 } 267 268 type ProjectArrayOutput struct{ *pulumi.OutputState } 269 270 func (ProjectArrayOutput) ElementType() reflect.Type { 271 return reflect.TypeOf((*[]*Project)(nil)).Elem() 272 } 273 274 func (o ProjectArrayOutput) ToProjectArrayOutput() ProjectArrayOutput { 275 return o 276 } 277 278 func (o ProjectArrayOutput) ToProjectArrayOutputWithContext(ctx context.Context) ProjectArrayOutput { 279 return o 280 } 281 282 func (o ProjectArrayOutput) Index(i pulumi.IntInput) ProjectOutput { 283 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Project { 284 return vs[0].([]*Project)[vs[1].(int)] 285 }).(ProjectOutput) 286 } 287 288 type ProjectMapOutput struct{ *pulumi.OutputState } 289 290 func (ProjectMapOutput) ElementType() reflect.Type { 291 return reflect.TypeOf((*map[string]*Project)(nil)).Elem() 292 } 293 294 func (o ProjectMapOutput) ToProjectMapOutput() ProjectMapOutput { 295 return o 296 } 297 298 func (o ProjectMapOutput) ToProjectMapOutputWithContext(ctx context.Context) ProjectMapOutput { 299 return o 300 } 301 302 func (o ProjectMapOutput) MapIndex(k pulumi.StringInput) ProjectOutput { 303 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Project { 304 return vs[0].(map[string]*Project)[vs[1].(string)] 305 }).(ProjectOutput) 306 } 307 308 func init() { 309 pulumi.RegisterInputType(reflect.TypeOf((*ProjectInput)(nil)).Elem(), &Project{}) 310 pulumi.RegisterInputType(reflect.TypeOf((*ProjectArrayInput)(nil)).Elem(), ProjectArray{}) 311 pulumi.RegisterInputType(reflect.TypeOf((*ProjectMapInput)(nil)).Elem(), ProjectMap{}) 312 pulumi.RegisterOutputType(ProjectOutput{}) 313 pulumi.RegisterOutputType(ProjectArrayOutput{}) 314 pulumi.RegisterOutputType(ProjectMapOutput{}) 315 }