// Code generated by pulumi-language-go DO NOT EDIT. // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** package incus import ( "context" "reflect" "errors" "git.kalinow.ski/kiterun/pulumi-incus/sdk/go/incus/internal" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // ## # Certificate // // Manages an Incus certificate. type Certificate struct { pulumi.CustomResourceState // **Required** - The certificate. Certificate pulumi.StringOutput `pulumi:"certificate"` // *Optional* - Description of the certificate. Description pulumi.StringOutput `pulumi:"description"` // The fingerprint of the certificate. Fingerprint pulumi.StringOutput `pulumi:"fingerprint"` // **Required** - Name of the certificate. Name pulumi.StringOutput `pulumi:"name"` // *Optional* - List of projects to restrict the certificate to. Projects pulumi.StringArrayOutput `pulumi:"projects"` // *Optional* - The remote in which the resource will be created. If // not provided, the provider's default remote will be used. Remote pulumi.StringPtrOutput `pulumi:"remote"` // *Optional* - Restrict the certificate to one or more projects. Restricted pulumi.BoolOutput `pulumi:"restricted"` // *Optional* - The type of certificate to create. Can be one of: client, // or metrics. If no type is specified, a client certificate is created. Type pulumi.StringOutput `pulumi:"type"` } // NewCertificate registers a new resource with the given unique name, arguments, and options. func NewCertificate(ctx *pulumi.Context, name string, args *CertificateArgs, opts ...pulumi.ResourceOption) (*Certificate, error) { if args == nil { return nil, errors.New("missing one or more required arguments") } if args.Certificate == nil { return nil, errors.New("invalid value for required argument 'Certificate'") } if args.Name == nil { return nil, errors.New("invalid value for required argument 'Name'") } opts = internal.PkgResourceDefaultOpts(opts) var resource Certificate err := ctx.RegisterResource("incus:index/certificate:Certificate", name, args, &resource, opts...) if err != nil { return nil, err } return &resource, nil } // GetCertificate gets an existing Certificate resource's state with the given name, ID, and optional // state properties that are used to uniquely qualify the lookup (nil if not required). func GetCertificate(ctx *pulumi.Context, name string, id pulumi.IDInput, state *CertificateState, opts ...pulumi.ResourceOption) (*Certificate, error) { var resource Certificate err := ctx.ReadResource("incus:index/certificate:Certificate", name, id, state, &resource, opts...) if err != nil { return nil, err } return &resource, nil } // Input properties used for looking up and filtering Certificate resources. type certificateState struct { // **Required** - The certificate. Certificate *string `pulumi:"certificate"` // *Optional* - Description of the certificate. Description *string `pulumi:"description"` // The fingerprint of the certificate. Fingerprint *string `pulumi:"fingerprint"` // **Required** - Name of the certificate. Name *string `pulumi:"name"` // *Optional* - List of projects to restrict the certificate to. Projects []string `pulumi:"projects"` // *Optional* - The remote in which the resource will be created. If // not provided, the provider's default remote will be used. Remote *string `pulumi:"remote"` // *Optional* - Restrict the certificate to one or more projects. Restricted *bool `pulumi:"restricted"` // *Optional* - The type of certificate to create. Can be one of: client, // or metrics. If no type is specified, a client certificate is created. Type *string `pulumi:"type"` } type CertificateState struct { // **Required** - The certificate. Certificate pulumi.StringPtrInput // *Optional* - Description of the certificate. Description pulumi.StringPtrInput // The fingerprint of the certificate. Fingerprint pulumi.StringPtrInput // **Required** - Name of the certificate. Name pulumi.StringPtrInput // *Optional* - List of projects to restrict the certificate to. Projects pulumi.StringArrayInput // *Optional* - The remote in which the resource will be created. If // not provided, the provider's default remote will be used. Remote pulumi.StringPtrInput // *Optional* - Restrict the certificate to one or more projects. Restricted pulumi.BoolPtrInput // *Optional* - The type of certificate to create. Can be one of: client, // or metrics. If no type is specified, a client certificate is created. Type pulumi.StringPtrInput } func (CertificateState) ElementType() reflect.Type { return reflect.TypeOf((*certificateState)(nil)).Elem() } type certificateArgs struct { // **Required** - The certificate. Certificate string `pulumi:"certificate"` // *Optional* - Description of the certificate. Description *string `pulumi:"description"` // **Required** - Name of the certificate. Name string `pulumi:"name"` // *Optional* - List of projects to restrict the certificate to. Projects []string `pulumi:"projects"` // *Optional* - The remote in which the resource will be created. If // not provided, the provider's default remote will be used. Remote *string `pulumi:"remote"` // *Optional* - Restrict the certificate to one or more projects. Restricted *bool `pulumi:"restricted"` // *Optional* - The type of certificate to create. Can be one of: client, // or metrics. If no type is specified, a client certificate is created. Type *string `pulumi:"type"` } // The set of arguments for constructing a Certificate resource. type CertificateArgs struct { // **Required** - The certificate. Certificate pulumi.StringInput // *Optional* - Description of the certificate. Description pulumi.StringPtrInput // **Required** - Name of the certificate. Name pulumi.StringInput // *Optional* - List of projects to restrict the certificate to. Projects pulumi.StringArrayInput // *Optional* - The remote in which the resource will be created. If // not provided, the provider's default remote will be used. Remote pulumi.StringPtrInput // *Optional* - Restrict the certificate to one or more projects. Restricted pulumi.BoolPtrInput // *Optional* - The type of certificate to create. Can be one of: client, // or metrics. If no type is specified, a client certificate is created. Type pulumi.StringPtrInput } func (CertificateArgs) ElementType() reflect.Type { return reflect.TypeOf((*certificateArgs)(nil)).Elem() } type CertificateInput interface { pulumi.Input ToCertificateOutput() CertificateOutput ToCertificateOutputWithContext(ctx context.Context) CertificateOutput } func (*Certificate) ElementType() reflect.Type { return reflect.TypeOf((**Certificate)(nil)).Elem() } func (i *Certificate) ToCertificateOutput() CertificateOutput { return i.ToCertificateOutputWithContext(context.Background()) } func (i *Certificate) ToCertificateOutputWithContext(ctx context.Context) CertificateOutput { return pulumi.ToOutputWithContext(ctx, i).(CertificateOutput) } // CertificateArrayInput is an input type that accepts CertificateArray and CertificateArrayOutput values. // You can construct a concrete instance of `CertificateArrayInput` via: // // CertificateArray{ CertificateArgs{...} } type CertificateArrayInput interface { pulumi.Input ToCertificateArrayOutput() CertificateArrayOutput ToCertificateArrayOutputWithContext(context.Context) CertificateArrayOutput } type CertificateArray []CertificateInput func (CertificateArray) ElementType() reflect.Type { return reflect.TypeOf((*[]*Certificate)(nil)).Elem() } func (i CertificateArray) ToCertificateArrayOutput() CertificateArrayOutput { return i.ToCertificateArrayOutputWithContext(context.Background()) } func (i CertificateArray) ToCertificateArrayOutputWithContext(ctx context.Context) CertificateArrayOutput { return pulumi.ToOutputWithContext(ctx, i).(CertificateArrayOutput) } // CertificateMapInput is an input type that accepts CertificateMap and CertificateMapOutput values. // You can construct a concrete instance of `CertificateMapInput` via: // // CertificateMap{ "key": CertificateArgs{...} } type CertificateMapInput interface { pulumi.Input ToCertificateMapOutput() CertificateMapOutput ToCertificateMapOutputWithContext(context.Context) CertificateMapOutput } type CertificateMap map[string]CertificateInput func (CertificateMap) ElementType() reflect.Type { return reflect.TypeOf((*map[string]*Certificate)(nil)).Elem() } func (i CertificateMap) ToCertificateMapOutput() CertificateMapOutput { return i.ToCertificateMapOutputWithContext(context.Background()) } func (i CertificateMap) ToCertificateMapOutputWithContext(ctx context.Context) CertificateMapOutput { return pulumi.ToOutputWithContext(ctx, i).(CertificateMapOutput) } type CertificateOutput struct{ *pulumi.OutputState } func (CertificateOutput) ElementType() reflect.Type { return reflect.TypeOf((**Certificate)(nil)).Elem() } func (o CertificateOutput) ToCertificateOutput() CertificateOutput { return o } func (o CertificateOutput) ToCertificateOutputWithContext(ctx context.Context) CertificateOutput { return o } // **Required** - The certificate. func (o CertificateOutput) Certificate() pulumi.StringOutput { return o.ApplyT(func(v *Certificate) pulumi.StringOutput { return v.Certificate }).(pulumi.StringOutput) } // *Optional* - Description of the certificate. func (o CertificateOutput) Description() pulumi.StringOutput { return o.ApplyT(func(v *Certificate) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput) } // The fingerprint of the certificate. func (o CertificateOutput) Fingerprint() pulumi.StringOutput { return o.ApplyT(func(v *Certificate) pulumi.StringOutput { return v.Fingerprint }).(pulumi.StringOutput) } // **Required** - Name of the certificate. func (o CertificateOutput) Name() pulumi.StringOutput { return o.ApplyT(func(v *Certificate) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) } // *Optional* - List of projects to restrict the certificate to. func (o CertificateOutput) Projects() pulumi.StringArrayOutput { return o.ApplyT(func(v *Certificate) pulumi.StringArrayOutput { return v.Projects }).(pulumi.StringArrayOutput) } // *Optional* - The remote in which the resource will be created. If // not provided, the provider's default remote will be used. func (o CertificateOutput) Remote() pulumi.StringPtrOutput { return o.ApplyT(func(v *Certificate) pulumi.StringPtrOutput { return v.Remote }).(pulumi.StringPtrOutput) } // *Optional* - Restrict the certificate to one or more projects. func (o CertificateOutput) Restricted() pulumi.BoolOutput { return o.ApplyT(func(v *Certificate) pulumi.BoolOutput { return v.Restricted }).(pulumi.BoolOutput) } // *Optional* - The type of certificate to create. Can be one of: client, // or metrics. If no type is specified, a client certificate is created. func (o CertificateOutput) Type() pulumi.StringOutput { return o.ApplyT(func(v *Certificate) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput) } type CertificateArrayOutput struct{ *pulumi.OutputState } func (CertificateArrayOutput) ElementType() reflect.Type { return reflect.TypeOf((*[]*Certificate)(nil)).Elem() } func (o CertificateArrayOutput) ToCertificateArrayOutput() CertificateArrayOutput { return o } func (o CertificateArrayOutput) ToCertificateArrayOutputWithContext(ctx context.Context) CertificateArrayOutput { return o } func (o CertificateArrayOutput) Index(i pulumi.IntInput) CertificateOutput { return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Certificate { return vs[0].([]*Certificate)[vs[1].(int)] }).(CertificateOutput) } type CertificateMapOutput struct{ *pulumi.OutputState } func (CertificateMapOutput) ElementType() reflect.Type { return reflect.TypeOf((*map[string]*Certificate)(nil)).Elem() } func (o CertificateMapOutput) ToCertificateMapOutput() CertificateMapOutput { return o } func (o CertificateMapOutput) ToCertificateMapOutputWithContext(ctx context.Context) CertificateMapOutput { return o } func (o CertificateMapOutput) MapIndex(k pulumi.StringInput) CertificateOutput { return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Certificate { return vs[0].(map[string]*Certificate)[vs[1].(string)] }).(CertificateOutput) } func init() { pulumi.RegisterInputType(reflect.TypeOf((*CertificateInput)(nil)).Elem(), &Certificate{}) pulumi.RegisterInputType(reflect.TypeOf((*CertificateArrayInput)(nil)).Elem(), CertificateArray{}) pulumi.RegisterInputType(reflect.TypeOf((*CertificateMapInput)(nil)).Elem(), CertificateMap{}) pulumi.RegisterOutputType(CertificateOutput{}) pulumi.RegisterOutputType(CertificateArrayOutput{}) pulumi.RegisterOutputType(CertificateMapOutput{}) }