action hetzner_post_certificates { label: "Create a Certificate" description: "Creates a new Certificate.\n\nThe default type **uploaded** allows for uploading your existing `certificate` and `private_key` in PEM format. You have to monitor its expiration date and handle renewal yourself.\n\nIn contrast, type **managed** requests a new Certificate from *Let's Encrypt* for the specified `domain_names`. Only domains managed by *Hetzner DNS* are supported. We handle renewal and timely alert the project owner via email if problems occur.\n\nFor type `managed` Certificates the `action` key of the response contains the Action that allows for tracking the issuance process. For type `uploaded` Certificates the `action` is always null.\n" provider: hetzner method: POST path: "/certificates" encoding: json input: { type: "object" required: ["name"] properties: { certificate: { type: "string" description: "Certificate and chain in PEM format, in order so that each record directly certifies the one preceding. Required for type `uploaded` Certificates." } domain_names: { type: "array" description: "Domains and subdomains that should be contained in the Certificate issued by *Let's Encrypt*. Required for type `managed` Certificates." items: { type: "string" } } labels: { type: "object" description: "User-defined labels (key-value pairs)" } name: { type: "string" description: "Name of the Certificate" } private_key: { type: "string" description: "Certificate key in PEM format. Required for type `uploaded` Certificates." } type: { type: "string" description: "Choose between uploading a Certificate in PEM format or requesting a managed *Let's Encrypt* Certificate. If omitted defaults to `uploaded`." enum: ["uploaded", "managed"] } } } output: { type: "object" required: ["certificate"] properties: { action: { type: "object" required: ["command", "error", "finished", "id", "progress", "resources", "started", "status"] properties: { command: { type: "string" description: "Command executed in the Action" } error: { type: "object" description: "Error message for the Action if error occurred, otherwise null" required: ["code", "message"] properties: { code: { type: "string" description: "Fixed machine readable code" } message: { type: "string" description: "Humanized error message" } } } finished: { type: "string" description: "Point in time when the Action was finished (in ISO-8601 format). Only set if the Action is finished otherwise null." } id: { type: "integer" description: "ID of the Resource" } progress: { type: "number" description: "Progress of Action in percent" } resources: { type: "array" description: "Resources the Action relates to" items: { type: "object" required: ["id", "type"] properties: { id: { type: "integer" description: "ID of the Resource" } type: { type: "string" description: "Type of resource referenced" } } } } started: { type: "string" description: "Point in time when the Action was started (in ISO-8601 format)" } status: { type: "string" description: "Status of the Action" enum: ["success", "running", "error"] } } } certificate: { type: "object" required: ["certificate", "created", "domain_names", "fingerprint", "id", "labels", "name", "not_valid_after", "not_valid_before", "used_by"] properties: { certificate: { type: "string" description: "Certificate and chain in PEM format, in order so that each record directly certifies the one preceding" } created: { type: "string" description: "Point in time when the Resource was created (in ISO-8601 format)" } domain_names: { type: "array" description: "Domains and subdomains covered by the Certificate" items: { type: "string" } } fingerprint: { type: "string" description: "SHA256 fingerprint of the Certificate" } id: { type: "integer" description: "ID of the Resource" } labels: { type: "object" description: "User-defined labels (key-value pairs)" } name: { type: "string" description: "Name of the Resource. Must be unique per Project." } not_valid_after: { type: "string" description: "Point in time when the Certificate stops being valid (in ISO-8601 format)" } not_valid_before: { type: "string" description: "Point in time when the Certificate becomes valid (in ISO-8601 format)" } status: { type: "object" description: "Current status of a type `managed` Certificate, always *null* for type `uploaded` Certificates" properties: { error: { type: "object" description: "If issuance or renewal reports `failed`, this property contains information about what happened" properties: { code: { type: "string" } message: { type: "string" } } } issuance: { type: "string" description: "Status of the issuance process of the Certificate" enum: ["pending", "completed", "failed"] } renewal: { type: "string" description: "Status of the renewal process of the Certificate." enum: ["scheduled", "pending", "failed", "unavailable"] } } } type: { type: "string" description: "Type of the Certificate" enum: ["uploaded", "managed"] } used_by: { type: "array" description: "Resources currently using the Certificate" items: { type: "object" required: ["id", "type"] properties: { id: { type: "integer" description: "ID of resource referenced" } type: { type: "string" description: "Type of resource referenced" } } } } } } } } }