github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/codecatalyst/sourceRepository.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 Source Repository. 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.NewSourceRepository(ctx, "example", &codecatalyst.SourceRepositoryArgs{ 35 // Name: pulumi.String("example-repo"), 36 // ProjectName: pulumi.String("example-project"), 37 // SpaceName: pulumi.String("example-space"), 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 Source Repository using the `id`. For example: 52 // 53 // ```sh 54 // $ pulumi import aws:codecatalyst/sourceRepository:SourceRepository example example-repo 55 // ``` 56 type SourceRepository 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 name of the source repository. For more information about name requirements, see [Quotas for source repositories](https://docs.aws.amazon.com/codecatalyst/latest/userguide/source-quotas.html). 62 Name pulumi.StringOutput `pulumi:"name"` 63 // The name of the project in the CodeCatalyst space. 64 // 65 // The following arguments are optional: 66 ProjectName pulumi.StringOutput `pulumi:"projectName"` 67 // The name of the CodeCatalyst space. 68 SpaceName pulumi.StringOutput `pulumi:"spaceName"` 69 } 70 71 // NewSourceRepository registers a new resource with the given unique name, arguments, and options. 72 func NewSourceRepository(ctx *pulumi.Context, 73 name string, args *SourceRepositoryArgs, opts ...pulumi.ResourceOption) (*SourceRepository, error) { 74 if args == nil { 75 return nil, errors.New("missing one or more required arguments") 76 } 77 78 if args.ProjectName == nil { 79 return nil, errors.New("invalid value for required argument 'ProjectName'") 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 SourceRepository 86 err := ctx.RegisterResource("aws:codecatalyst/sourceRepository:SourceRepository", name, args, &resource, opts...) 87 if err != nil { 88 return nil, err 89 } 90 return &resource, nil 91 } 92 93 // GetSourceRepository gets an existing SourceRepository 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 GetSourceRepository(ctx *pulumi.Context, 96 name string, id pulumi.IDInput, state *SourceRepositoryState, opts ...pulumi.ResourceOption) (*SourceRepository, error) { 97 var resource SourceRepository 98 err := ctx.ReadResource("aws:codecatalyst/sourceRepository:SourceRepository", 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 SourceRepository resources. 106 type sourceRepositoryState 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 name of the source repository. For more information about name requirements, see [Quotas for source repositories](https://docs.aws.amazon.com/codecatalyst/latest/userguide/source-quotas.html). 110 Name *string `pulumi:"name"` 111 // The name of the project in the CodeCatalyst space. 112 // 113 // The following arguments are optional: 114 ProjectName *string `pulumi:"projectName"` 115 // The name of the CodeCatalyst space. 116 SpaceName *string `pulumi:"spaceName"` 117 } 118 119 type SourceRepositoryState 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 name of the source repository. For more information about name requirements, see [Quotas for source repositories](https://docs.aws.amazon.com/codecatalyst/latest/userguide/source-quotas.html). 123 Name pulumi.StringPtrInput 124 // The name of the project in the CodeCatalyst space. 125 // 126 // The following arguments are optional: 127 ProjectName pulumi.StringPtrInput 128 // The name of the CodeCatalyst space. 129 SpaceName pulumi.StringPtrInput 130 } 131 132 func (SourceRepositoryState) ElementType() reflect.Type { 133 return reflect.TypeOf((*sourceRepositoryState)(nil)).Elem() 134 } 135 136 type sourceRepositoryArgs 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 name of the source repository. For more information about name requirements, see [Quotas for source repositories](https://docs.aws.amazon.com/codecatalyst/latest/userguide/source-quotas.html). 140 Name *string `pulumi:"name"` 141 // The name of the project in the CodeCatalyst space. 142 // 143 // The following arguments are optional: 144 ProjectName string `pulumi:"projectName"` 145 // The name of the CodeCatalyst space. 146 SpaceName string `pulumi:"spaceName"` 147 } 148 149 // The set of arguments for constructing a SourceRepository resource. 150 type SourceRepositoryArgs struct { 151 // 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. 152 Description pulumi.StringPtrInput 153 // The name of the source repository. For more information about name requirements, see [Quotas for source repositories](https://docs.aws.amazon.com/codecatalyst/latest/userguide/source-quotas.html). 154 Name pulumi.StringPtrInput 155 // The name of the project in the CodeCatalyst space. 156 // 157 // The following arguments are optional: 158 ProjectName pulumi.StringInput 159 // The name of the CodeCatalyst space. 160 SpaceName pulumi.StringInput 161 } 162 163 func (SourceRepositoryArgs) ElementType() reflect.Type { 164 return reflect.TypeOf((*sourceRepositoryArgs)(nil)).Elem() 165 } 166 167 type SourceRepositoryInput interface { 168 pulumi.Input 169 170 ToSourceRepositoryOutput() SourceRepositoryOutput 171 ToSourceRepositoryOutputWithContext(ctx context.Context) SourceRepositoryOutput 172 } 173 174 func (*SourceRepository) ElementType() reflect.Type { 175 return reflect.TypeOf((**SourceRepository)(nil)).Elem() 176 } 177 178 func (i *SourceRepository) ToSourceRepositoryOutput() SourceRepositoryOutput { 179 return i.ToSourceRepositoryOutputWithContext(context.Background()) 180 } 181 182 func (i *SourceRepository) ToSourceRepositoryOutputWithContext(ctx context.Context) SourceRepositoryOutput { 183 return pulumi.ToOutputWithContext(ctx, i).(SourceRepositoryOutput) 184 } 185 186 // SourceRepositoryArrayInput is an input type that accepts SourceRepositoryArray and SourceRepositoryArrayOutput values. 187 // You can construct a concrete instance of `SourceRepositoryArrayInput` via: 188 // 189 // SourceRepositoryArray{ SourceRepositoryArgs{...} } 190 type SourceRepositoryArrayInput interface { 191 pulumi.Input 192 193 ToSourceRepositoryArrayOutput() SourceRepositoryArrayOutput 194 ToSourceRepositoryArrayOutputWithContext(context.Context) SourceRepositoryArrayOutput 195 } 196 197 type SourceRepositoryArray []SourceRepositoryInput 198 199 func (SourceRepositoryArray) ElementType() reflect.Type { 200 return reflect.TypeOf((*[]*SourceRepository)(nil)).Elem() 201 } 202 203 func (i SourceRepositoryArray) ToSourceRepositoryArrayOutput() SourceRepositoryArrayOutput { 204 return i.ToSourceRepositoryArrayOutputWithContext(context.Background()) 205 } 206 207 func (i SourceRepositoryArray) ToSourceRepositoryArrayOutputWithContext(ctx context.Context) SourceRepositoryArrayOutput { 208 return pulumi.ToOutputWithContext(ctx, i).(SourceRepositoryArrayOutput) 209 } 210 211 // SourceRepositoryMapInput is an input type that accepts SourceRepositoryMap and SourceRepositoryMapOutput values. 212 // You can construct a concrete instance of `SourceRepositoryMapInput` via: 213 // 214 // SourceRepositoryMap{ "key": SourceRepositoryArgs{...} } 215 type SourceRepositoryMapInput interface { 216 pulumi.Input 217 218 ToSourceRepositoryMapOutput() SourceRepositoryMapOutput 219 ToSourceRepositoryMapOutputWithContext(context.Context) SourceRepositoryMapOutput 220 } 221 222 type SourceRepositoryMap map[string]SourceRepositoryInput 223 224 func (SourceRepositoryMap) ElementType() reflect.Type { 225 return reflect.TypeOf((*map[string]*SourceRepository)(nil)).Elem() 226 } 227 228 func (i SourceRepositoryMap) ToSourceRepositoryMapOutput() SourceRepositoryMapOutput { 229 return i.ToSourceRepositoryMapOutputWithContext(context.Background()) 230 } 231 232 func (i SourceRepositoryMap) ToSourceRepositoryMapOutputWithContext(ctx context.Context) SourceRepositoryMapOutput { 233 return pulumi.ToOutputWithContext(ctx, i).(SourceRepositoryMapOutput) 234 } 235 236 type SourceRepositoryOutput struct{ *pulumi.OutputState } 237 238 func (SourceRepositoryOutput) ElementType() reflect.Type { 239 return reflect.TypeOf((**SourceRepository)(nil)).Elem() 240 } 241 242 func (o SourceRepositoryOutput) ToSourceRepositoryOutput() SourceRepositoryOutput { 243 return o 244 } 245 246 func (o SourceRepositoryOutput) ToSourceRepositoryOutputWithContext(ctx context.Context) SourceRepositoryOutput { 247 return o 248 } 249 250 // 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. 251 func (o SourceRepositoryOutput) Description() pulumi.StringPtrOutput { 252 return o.ApplyT(func(v *SourceRepository) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 253 } 254 255 // The name of the source repository. For more information about name requirements, see [Quotas for source repositories](https://docs.aws.amazon.com/codecatalyst/latest/userguide/source-quotas.html). 256 func (o SourceRepositoryOutput) Name() pulumi.StringOutput { 257 return o.ApplyT(func(v *SourceRepository) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 258 } 259 260 // The name of the project in the CodeCatalyst space. 261 // 262 // The following arguments are optional: 263 func (o SourceRepositoryOutput) ProjectName() pulumi.StringOutput { 264 return o.ApplyT(func(v *SourceRepository) pulumi.StringOutput { return v.ProjectName }).(pulumi.StringOutput) 265 } 266 267 // The name of the CodeCatalyst space. 268 func (o SourceRepositoryOutput) SpaceName() pulumi.StringOutput { 269 return o.ApplyT(func(v *SourceRepository) pulumi.StringOutput { return v.SpaceName }).(pulumi.StringOutput) 270 } 271 272 type SourceRepositoryArrayOutput struct{ *pulumi.OutputState } 273 274 func (SourceRepositoryArrayOutput) ElementType() reflect.Type { 275 return reflect.TypeOf((*[]*SourceRepository)(nil)).Elem() 276 } 277 278 func (o SourceRepositoryArrayOutput) ToSourceRepositoryArrayOutput() SourceRepositoryArrayOutput { 279 return o 280 } 281 282 func (o SourceRepositoryArrayOutput) ToSourceRepositoryArrayOutputWithContext(ctx context.Context) SourceRepositoryArrayOutput { 283 return o 284 } 285 286 func (o SourceRepositoryArrayOutput) Index(i pulumi.IntInput) SourceRepositoryOutput { 287 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SourceRepository { 288 return vs[0].([]*SourceRepository)[vs[1].(int)] 289 }).(SourceRepositoryOutput) 290 } 291 292 type SourceRepositoryMapOutput struct{ *pulumi.OutputState } 293 294 func (SourceRepositoryMapOutput) ElementType() reflect.Type { 295 return reflect.TypeOf((*map[string]*SourceRepository)(nil)).Elem() 296 } 297 298 func (o SourceRepositoryMapOutput) ToSourceRepositoryMapOutput() SourceRepositoryMapOutput { 299 return o 300 } 301 302 func (o SourceRepositoryMapOutput) ToSourceRepositoryMapOutputWithContext(ctx context.Context) SourceRepositoryMapOutput { 303 return o 304 } 305 306 func (o SourceRepositoryMapOutput) MapIndex(k pulumi.StringInput) SourceRepositoryOutput { 307 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SourceRepository { 308 return vs[0].(map[string]*SourceRepository)[vs[1].(string)] 309 }).(SourceRepositoryOutput) 310 } 311 312 func init() { 313 pulumi.RegisterInputType(reflect.TypeOf((*SourceRepositoryInput)(nil)).Elem(), &SourceRepository{}) 314 pulumi.RegisterInputType(reflect.TypeOf((*SourceRepositoryArrayInput)(nil)).Elem(), SourceRepositoryArray{}) 315 pulumi.RegisterInputType(reflect.TypeOf((*SourceRepositoryMapInput)(nil)).Elem(), SourceRepositoryMap{}) 316 pulumi.RegisterOutputType(SourceRepositoryOutput{}) 317 pulumi.RegisterOutputType(SourceRepositoryArrayOutput{}) 318 pulumi.RegisterOutputType(SourceRepositoryMapOutput{}) 319 }