github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/servicecatalog/portfolio.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 servicecatalog 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 resource to create a Service Catalog Portfolio. 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/servicecatalog" 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 := servicecatalog.NewPortfolio(ctx, "portfolio", &servicecatalog.PortfolioArgs{ 33 // Name: pulumi.String("My App Portfolio"), 34 // Description: pulumi.String("List of my organizations apps"), 35 // ProviderName: pulumi.String("Brett"), 36 // }) 37 // if err != nil { 38 // return err 39 // } 40 // return nil 41 // }) 42 // } 43 // 44 // ``` 45 // <!--End PulumiCodeChooser --> 46 // 47 // ## Import 48 // 49 // Using `pulumi import`, import Service Catalog Portfolios using the Service Catalog Portfolio `id`. For example: 50 // 51 // ```sh 52 // $ pulumi import aws:servicecatalog/portfolio:Portfolio testfolio port-12344321 53 // ``` 54 type Portfolio struct { 55 pulumi.CustomResourceState 56 57 Arn pulumi.StringOutput `pulumi:"arn"` 58 CreatedTime pulumi.StringOutput `pulumi:"createdTime"` 59 // Description of the portfolio 60 Description pulumi.StringOutput `pulumi:"description"` 61 // The name of the portfolio. 62 Name pulumi.StringOutput `pulumi:"name"` 63 // Name of the person or organization who owns the portfolio. 64 ProviderName pulumi.StringOutput `pulumi:"providerName"` 65 // Tags to apply to the connection. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 66 Tags pulumi.StringMapOutput `pulumi:"tags"` 67 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 68 // 69 // Deprecated: Please use `tags` instead. 70 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 71 } 72 73 // NewPortfolio registers a new resource with the given unique name, arguments, and options. 74 func NewPortfolio(ctx *pulumi.Context, 75 name string, args *PortfolioArgs, opts ...pulumi.ResourceOption) (*Portfolio, error) { 76 if args == nil { 77 return nil, errors.New("missing one or more required arguments") 78 } 79 80 if args.ProviderName == nil { 81 return nil, errors.New("invalid value for required argument 'ProviderName'") 82 } 83 opts = internal.PkgResourceDefaultOpts(opts) 84 var resource Portfolio 85 err := ctx.RegisterResource("aws:servicecatalog/portfolio:Portfolio", name, args, &resource, opts...) 86 if err != nil { 87 return nil, err 88 } 89 return &resource, nil 90 } 91 92 // GetPortfolio gets an existing Portfolio resource's state with the given name, ID, and optional 93 // state properties that are used to uniquely qualify the lookup (nil if not required). 94 func GetPortfolio(ctx *pulumi.Context, 95 name string, id pulumi.IDInput, state *PortfolioState, opts ...pulumi.ResourceOption) (*Portfolio, error) { 96 var resource Portfolio 97 err := ctx.ReadResource("aws:servicecatalog/portfolio:Portfolio", name, id, state, &resource, opts...) 98 if err != nil { 99 return nil, err 100 } 101 return &resource, nil 102 } 103 104 // Input properties used for looking up and filtering Portfolio resources. 105 type portfolioState struct { 106 Arn *string `pulumi:"arn"` 107 CreatedTime *string `pulumi:"createdTime"` 108 // Description of the portfolio 109 Description *string `pulumi:"description"` 110 // The name of the portfolio. 111 Name *string `pulumi:"name"` 112 // Name of the person or organization who owns the portfolio. 113 ProviderName *string `pulumi:"providerName"` 114 // Tags to apply to the connection. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 115 Tags map[string]string `pulumi:"tags"` 116 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 117 // 118 // Deprecated: Please use `tags` instead. 119 TagsAll map[string]string `pulumi:"tagsAll"` 120 } 121 122 type PortfolioState struct { 123 Arn pulumi.StringPtrInput 124 CreatedTime pulumi.StringPtrInput 125 // Description of the portfolio 126 Description pulumi.StringPtrInput 127 // The name of the portfolio. 128 Name pulumi.StringPtrInput 129 // Name of the person or organization who owns the portfolio. 130 ProviderName pulumi.StringPtrInput 131 // Tags to apply to the connection. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 132 Tags pulumi.StringMapInput 133 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 134 // 135 // Deprecated: Please use `tags` instead. 136 TagsAll pulumi.StringMapInput 137 } 138 139 func (PortfolioState) ElementType() reflect.Type { 140 return reflect.TypeOf((*portfolioState)(nil)).Elem() 141 } 142 143 type portfolioArgs struct { 144 // Description of the portfolio 145 Description *string `pulumi:"description"` 146 // The name of the portfolio. 147 Name *string `pulumi:"name"` 148 // Name of the person or organization who owns the portfolio. 149 ProviderName string `pulumi:"providerName"` 150 // Tags to apply to the connection. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 151 Tags map[string]string `pulumi:"tags"` 152 } 153 154 // The set of arguments for constructing a Portfolio resource. 155 type PortfolioArgs struct { 156 // Description of the portfolio 157 Description pulumi.StringPtrInput 158 // The name of the portfolio. 159 Name pulumi.StringPtrInput 160 // Name of the person or organization who owns the portfolio. 161 ProviderName pulumi.StringInput 162 // Tags to apply to the connection. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 163 Tags pulumi.StringMapInput 164 } 165 166 func (PortfolioArgs) ElementType() reflect.Type { 167 return reflect.TypeOf((*portfolioArgs)(nil)).Elem() 168 } 169 170 type PortfolioInput interface { 171 pulumi.Input 172 173 ToPortfolioOutput() PortfolioOutput 174 ToPortfolioOutputWithContext(ctx context.Context) PortfolioOutput 175 } 176 177 func (*Portfolio) ElementType() reflect.Type { 178 return reflect.TypeOf((**Portfolio)(nil)).Elem() 179 } 180 181 func (i *Portfolio) ToPortfolioOutput() PortfolioOutput { 182 return i.ToPortfolioOutputWithContext(context.Background()) 183 } 184 185 func (i *Portfolio) ToPortfolioOutputWithContext(ctx context.Context) PortfolioOutput { 186 return pulumi.ToOutputWithContext(ctx, i).(PortfolioOutput) 187 } 188 189 // PortfolioArrayInput is an input type that accepts PortfolioArray and PortfolioArrayOutput values. 190 // You can construct a concrete instance of `PortfolioArrayInput` via: 191 // 192 // PortfolioArray{ PortfolioArgs{...} } 193 type PortfolioArrayInput interface { 194 pulumi.Input 195 196 ToPortfolioArrayOutput() PortfolioArrayOutput 197 ToPortfolioArrayOutputWithContext(context.Context) PortfolioArrayOutput 198 } 199 200 type PortfolioArray []PortfolioInput 201 202 func (PortfolioArray) ElementType() reflect.Type { 203 return reflect.TypeOf((*[]*Portfolio)(nil)).Elem() 204 } 205 206 func (i PortfolioArray) ToPortfolioArrayOutput() PortfolioArrayOutput { 207 return i.ToPortfolioArrayOutputWithContext(context.Background()) 208 } 209 210 func (i PortfolioArray) ToPortfolioArrayOutputWithContext(ctx context.Context) PortfolioArrayOutput { 211 return pulumi.ToOutputWithContext(ctx, i).(PortfolioArrayOutput) 212 } 213 214 // PortfolioMapInput is an input type that accepts PortfolioMap and PortfolioMapOutput values. 215 // You can construct a concrete instance of `PortfolioMapInput` via: 216 // 217 // PortfolioMap{ "key": PortfolioArgs{...} } 218 type PortfolioMapInput interface { 219 pulumi.Input 220 221 ToPortfolioMapOutput() PortfolioMapOutput 222 ToPortfolioMapOutputWithContext(context.Context) PortfolioMapOutput 223 } 224 225 type PortfolioMap map[string]PortfolioInput 226 227 func (PortfolioMap) ElementType() reflect.Type { 228 return reflect.TypeOf((*map[string]*Portfolio)(nil)).Elem() 229 } 230 231 func (i PortfolioMap) ToPortfolioMapOutput() PortfolioMapOutput { 232 return i.ToPortfolioMapOutputWithContext(context.Background()) 233 } 234 235 func (i PortfolioMap) ToPortfolioMapOutputWithContext(ctx context.Context) PortfolioMapOutput { 236 return pulumi.ToOutputWithContext(ctx, i).(PortfolioMapOutput) 237 } 238 239 type PortfolioOutput struct{ *pulumi.OutputState } 240 241 func (PortfolioOutput) ElementType() reflect.Type { 242 return reflect.TypeOf((**Portfolio)(nil)).Elem() 243 } 244 245 func (o PortfolioOutput) ToPortfolioOutput() PortfolioOutput { 246 return o 247 } 248 249 func (o PortfolioOutput) ToPortfolioOutputWithContext(ctx context.Context) PortfolioOutput { 250 return o 251 } 252 253 func (o PortfolioOutput) Arn() pulumi.StringOutput { 254 return o.ApplyT(func(v *Portfolio) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 255 } 256 257 func (o PortfolioOutput) CreatedTime() pulumi.StringOutput { 258 return o.ApplyT(func(v *Portfolio) pulumi.StringOutput { return v.CreatedTime }).(pulumi.StringOutput) 259 } 260 261 // Description of the portfolio 262 func (o PortfolioOutput) Description() pulumi.StringOutput { 263 return o.ApplyT(func(v *Portfolio) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput) 264 } 265 266 // The name of the portfolio. 267 func (o PortfolioOutput) Name() pulumi.StringOutput { 268 return o.ApplyT(func(v *Portfolio) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 269 } 270 271 // Name of the person or organization who owns the portfolio. 272 func (o PortfolioOutput) ProviderName() pulumi.StringOutput { 273 return o.ApplyT(func(v *Portfolio) pulumi.StringOutput { return v.ProviderName }).(pulumi.StringOutput) 274 } 275 276 // Tags to apply to the connection. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 277 func (o PortfolioOutput) Tags() pulumi.StringMapOutput { 278 return o.ApplyT(func(v *Portfolio) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 279 } 280 281 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 282 // 283 // Deprecated: Please use `tags` instead. 284 func (o PortfolioOutput) TagsAll() pulumi.StringMapOutput { 285 return o.ApplyT(func(v *Portfolio) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 286 } 287 288 type PortfolioArrayOutput struct{ *pulumi.OutputState } 289 290 func (PortfolioArrayOutput) ElementType() reflect.Type { 291 return reflect.TypeOf((*[]*Portfolio)(nil)).Elem() 292 } 293 294 func (o PortfolioArrayOutput) ToPortfolioArrayOutput() PortfolioArrayOutput { 295 return o 296 } 297 298 func (o PortfolioArrayOutput) ToPortfolioArrayOutputWithContext(ctx context.Context) PortfolioArrayOutput { 299 return o 300 } 301 302 func (o PortfolioArrayOutput) Index(i pulumi.IntInput) PortfolioOutput { 303 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Portfolio { 304 return vs[0].([]*Portfolio)[vs[1].(int)] 305 }).(PortfolioOutput) 306 } 307 308 type PortfolioMapOutput struct{ *pulumi.OutputState } 309 310 func (PortfolioMapOutput) ElementType() reflect.Type { 311 return reflect.TypeOf((*map[string]*Portfolio)(nil)).Elem() 312 } 313 314 func (o PortfolioMapOutput) ToPortfolioMapOutput() PortfolioMapOutput { 315 return o 316 } 317 318 func (o PortfolioMapOutput) ToPortfolioMapOutputWithContext(ctx context.Context) PortfolioMapOutput { 319 return o 320 } 321 322 func (o PortfolioMapOutput) MapIndex(k pulumi.StringInput) PortfolioOutput { 323 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Portfolio { 324 return vs[0].(map[string]*Portfolio)[vs[1].(string)] 325 }).(PortfolioOutput) 326 } 327 328 func init() { 329 pulumi.RegisterInputType(reflect.TypeOf((*PortfolioInput)(nil)).Elem(), &Portfolio{}) 330 pulumi.RegisterInputType(reflect.TypeOf((*PortfolioArrayInput)(nil)).Elem(), PortfolioArray{}) 331 pulumi.RegisterInputType(reflect.TypeOf((*PortfolioMapInput)(nil)).Elem(), PortfolioMap{}) 332 pulumi.RegisterOutputType(PortfolioOutput{}) 333 pulumi.RegisterOutputType(PortfolioArrayOutput{}) 334 pulumi.RegisterOutputType(PortfolioMapOutput{}) 335 }