edgecenter.ProtectionResourceCertificate
Explore with Pulumi AI
Allows to manage SSL certificate for DDoS protection resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as edgecenter from "@pulumi/edgecenter";
const config = new pulumi.Config();
const cert = config.require("cert");
const privateKey = config.require("privateKey");
const protected1ExampleCom = new edgecenter.ProtectionResource("protected1ExampleCom", {tls: [
"1.2",
"1.3",
]});
//
// Set LE certificate
//
const protectionCustomCert = new edgecenter.ProtectionResourceCertificate("protectionCustomCert", {
resource: protected1ExampleCom.protectionResourceId,
sslType: "custom",
sslCrt: cert,
sslKey: privateKey,
});
const protected2ExampleCom = new edgecenter.ProtectionResource("protected2ExampleCom", {tls: [
"1.2",
"1.3",
]});
//
// Issuing LE certificate requires DNS record
//
const examplezone = new edgecenter.DnsZone("examplezone", {});
const protectedResourceRecord = new edgecenter.DnsZoneRecord("protectedResourceRecord", {
zone: examplezone.name,
domain: protected2ExampleCom.name,
type: "A",
ttl: 100,
resourceRecords: [{
content: protected2ExampleCom.ip,
}],
});
const protectionLeCert = new edgecenter.ProtectionResourceCertificate("protectionLeCert", {
resource: protected2ExampleCom.protectionResourceId,
sslType: "le",
}, {
dependsOn: [protectedResourceRecord],
});
import pulumi
import pulumi_edgecenter as edgecenter
config = pulumi.Config()
cert = config.require("cert")
private_key = config.require("privateKey")
protected1_example_com = edgecenter.ProtectionResource("protected1ExampleCom", tls=[
"1.2",
"1.3",
])
#
# Set LE certificate
#
protection_custom_cert = edgecenter.ProtectionResourceCertificate("protectionCustomCert",
resource=protected1_example_com.protection_resource_id,
ssl_type="custom",
ssl_crt=cert,
ssl_key=private_key)
protected2_example_com = edgecenter.ProtectionResource("protected2ExampleCom", tls=[
"1.2",
"1.3",
])
#
# Issuing LE certificate requires DNS record
#
examplezone = edgecenter.DnsZone("examplezone")
protected_resource_record = edgecenter.DnsZoneRecord("protectedResourceRecord",
zone=examplezone.name,
domain=protected2_example_com.name,
type="A",
ttl=100,
resource_records=[{
"content": protected2_example_com.ip,
}])
protection_le_cert = edgecenter.ProtectionResourceCertificate("protectionLeCert",
resource=protected2_example_com.protection_resource_id,
ssl_type="le",
opts = pulumi.ResourceOptions(depends_on=[protected_resource_record]))
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/edgecenter/edgecenter"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
cert := cfg.Require("cert")
privateKey := cfg.Require("privateKey")
protected1ExampleCom, err := edgecenter.NewProtectionResource(ctx, "protected1ExampleCom", &edgecenter.ProtectionResourceArgs{
Tls: pulumi.StringArray{
pulumi.String("1.2"),
pulumi.String("1.3"),
},
})
if err != nil {
return err
}
_, err = edgecenter.NewProtectionResourceCertificate(ctx, "protectionCustomCert", &edgecenter.ProtectionResourceCertificateArgs{
Resource: protected1ExampleCom.ProtectionResourceId,
SslType: pulumi.String("custom"),
SslCrt: pulumi.String(cert),
SslKey: pulumi.String(privateKey),
})
if err != nil {
return err
}
protected2ExampleCom, err := edgecenter.NewProtectionResource(ctx, "protected2ExampleCom", &edgecenter.ProtectionResourceArgs{
Tls: pulumi.StringArray{
pulumi.String("1.2"),
pulumi.String("1.3"),
},
})
if err != nil {
return err
}
// Issuing LE certificate requires DNS record
examplezone, err := edgecenter.NewDnsZone(ctx, "examplezone", nil)
if err != nil {
return err
}
protectedResourceRecord, err := edgecenter.NewDnsZoneRecord(ctx, "protectedResourceRecord", &edgecenter.DnsZoneRecordArgs{
Zone: examplezone.Name,
Domain: protected2ExampleCom.Name,
Type: pulumi.String("A"),
Ttl: pulumi.Float64(100),
ResourceRecords: edgecenter.DnsZoneRecordResourceRecordArray{
&edgecenter.DnsZoneRecordResourceRecordArgs{
Content: protected2ExampleCom.Ip,
},
},
})
if err != nil {
return err
}
_, err = edgecenter.NewProtectionResourceCertificate(ctx, "protectionLeCert", &edgecenter.ProtectionResourceCertificateArgs{
Resource: protected2ExampleCom.ProtectionResourceId,
SslType: pulumi.String("le"),
}, pulumi.DependsOn([]pulumi.Resource{
protectedResourceRecord,
}))
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Edgecenter = Pulumi.Edgecenter;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var cert = config.Require("cert");
var privateKey = config.Require("privateKey");
var protected1ExampleCom = new Edgecenter.ProtectionResource("protected1ExampleCom", new()
{
Tls = new[]
{
"1.2",
"1.3",
},
});
//
// Set LE certificate
//
var protectionCustomCert = new Edgecenter.ProtectionResourceCertificate("protectionCustomCert", new()
{
Resource = protected1ExampleCom.ProtectionResourceId,
SslType = "custom",
SslCrt = cert,
SslKey = privateKey,
});
var protected2ExampleCom = new Edgecenter.ProtectionResource("protected2ExampleCom", new()
{
Tls = new[]
{
"1.2",
"1.3",
},
});
//
// Issuing LE certificate requires DNS record
//
var examplezone = new Edgecenter.DnsZone("examplezone");
var protectedResourceRecord = new Edgecenter.DnsZoneRecord("protectedResourceRecord", new()
{
Zone = examplezone.Name,
Domain = protected2ExampleCom.Name,
Type = "A",
Ttl = 100,
ResourceRecords = new[]
{
new Edgecenter.Inputs.DnsZoneRecordResourceRecordArgs
{
Content = protected2ExampleCom.Ip,
},
},
});
var protectionLeCert = new Edgecenter.ProtectionResourceCertificate("protectionLeCert", new()
{
Resource = protected2ExampleCom.ProtectionResourceId,
SslType = "le",
}, new CustomResourceOptions
{
DependsOn =
{
protectedResourceRecord,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.edgecenter.ProtectionResource;
import com.pulumi.edgecenter.ProtectionResourceArgs;
import com.pulumi.edgecenter.ProtectionResourceCertificate;
import com.pulumi.edgecenter.ProtectionResourceCertificateArgs;
import com.pulumi.edgecenter.DnsZone;
import com.pulumi.edgecenter.DnsZoneRecord;
import com.pulumi.edgecenter.DnsZoneRecordArgs;
import com.pulumi.edgecenter.inputs.DnsZoneRecordResourceRecordArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var config = ctx.config();
final var cert = config.get("cert");
final var privateKey = config.get("privateKey");
var protected1ExampleCom = new ProtectionResource("protected1ExampleCom", ProtectionResourceArgs.builder()
.tls(
"1.2",
"1.3")
.build());
//
// Set LE certificate
//
var protectionCustomCert = new ProtectionResourceCertificate("protectionCustomCert", ProtectionResourceCertificateArgs.builder()
.resource(protected1ExampleCom.protectionResourceId())
.sslType("custom")
.sslCrt(cert)
.sslKey(privateKey)
.build());
var protected2ExampleCom = new ProtectionResource("protected2ExampleCom", ProtectionResourceArgs.builder()
.tls(
"1.2",
"1.3")
.build());
//
// Issuing LE certificate requires DNS record
//
var examplezone = new DnsZone("examplezone");
var protectedResourceRecord = new DnsZoneRecord("protectedResourceRecord", DnsZoneRecordArgs.builder()
.zone(examplezone.name())
.domain(protected2ExampleCom.name())
.type("A")
.ttl(100)
.resourceRecords(DnsZoneRecordResourceRecordArgs.builder()
.content(protected2ExampleCom.ip())
.build())
.build());
var protectionLeCert = new ProtectionResourceCertificate("protectionLeCert", ProtectionResourceCertificateArgs.builder()
.resource(protected2ExampleCom.protectionResourceId())
.sslType("le")
.build(), CustomResourceOptions.builder()
.dependsOn(protectedResourceRecord)
.build());
}
}
configuration:
cert:
type: string
privateKey:
type: string
resources:
protectionCustomCert:
type: edgecenter:ProtectionResourceCertificate
properties:
resource: ${protected1ExampleCom.protectionResourceId}
sslType: custom
sslCrt: ${cert}
sslKey: ${privateKey}
protected1ExampleCom: #
# Set LE certificate
#
type: edgecenter:ProtectionResource
properties:
tls:
- '1.2'
- '1.3'
protectionLeCert:
type: edgecenter:ProtectionResourceCertificate
properties:
resource: ${protected2ExampleCom.protectionResourceId}
sslType: le
options:
dependsOn:
- ${protectedResourceRecord}
protected2ExampleCom:
type: edgecenter:ProtectionResource
properties:
tls:
- '1.2'
- '1.3'
#
# Issuing LE certificate requires DNS record
#
examplezone:
type: edgecenter:DnsZone
protectedResourceRecord:
type: edgecenter:DnsZoneRecord
properties:
zone: ${examplezone.name}
domain: ${protected2ExampleCom.name}
type: A
ttl: 100
resourceRecords:
- content: ${protected2ExampleCom.ip}
Create ProtectionResourceCertificate Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ProtectionResourceCertificate(name: string, args: ProtectionResourceCertificateArgs, opts?: CustomResourceOptions);
@overload
def ProtectionResourceCertificate(resource_name: str,
args: ProtectionResourceCertificateArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ProtectionResourceCertificate(resource_name: str,
opts: Optional[ResourceOptions] = None,
resource: Optional[str] = None,
ssl_type: Optional[str] = None,
protection_resource_certificate_id: Optional[str] = None,
ssl_crt: Optional[str] = None,
ssl_key: Optional[str] = None)
func NewProtectionResourceCertificate(ctx *Context, name string, args ProtectionResourceCertificateArgs, opts ...ResourceOption) (*ProtectionResourceCertificate, error)
public ProtectionResourceCertificate(string name, ProtectionResourceCertificateArgs args, CustomResourceOptions? opts = null)
public ProtectionResourceCertificate(String name, ProtectionResourceCertificateArgs args)
public ProtectionResourceCertificate(String name, ProtectionResourceCertificateArgs args, CustomResourceOptions options)
type: edgecenter:ProtectionResourceCertificate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ProtectionResourceCertificateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ProtectionResourceCertificateArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ProtectionResourceCertificateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProtectionResourceCertificateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProtectionResourceCertificateArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var protectionResourceCertificateResource = new Edgecenter.ProtectionResourceCertificate("protectionResourceCertificateResource", new()
{
Resource = "string",
SslType = "string",
ProtectionResourceCertificateId = "string",
SslCrt = "string",
SslKey = "string",
});
example, err := edgecenter.NewProtectionResourceCertificate(ctx, "protectionResourceCertificateResource", &edgecenter.ProtectionResourceCertificateArgs{
Resource: pulumi.String("string"),
SslType: pulumi.String("string"),
ProtectionResourceCertificateId: pulumi.String("string"),
SslCrt: pulumi.String("string"),
SslKey: pulumi.String("string"),
})
var protectionResourceCertificateResource = new ProtectionResourceCertificate("protectionResourceCertificateResource", ProtectionResourceCertificateArgs.builder()
.resource("string")
.sslType("string")
.protectionResourceCertificateId("string")
.sslCrt("string")
.sslKey("string")
.build());
protection_resource_certificate_resource = edgecenter.ProtectionResourceCertificate("protectionResourceCertificateResource",
resource="string",
ssl_type="string",
protection_resource_certificate_id="string",
ssl_crt="string",
ssl_key="string")
const protectionResourceCertificateResource = new edgecenter.ProtectionResourceCertificate("protectionResourceCertificateResource", {
resource: "string",
sslType: "string",
protectionResourceCertificateId: "string",
sslCrt: "string",
sslKey: "string",
});
type: edgecenter:ProtectionResourceCertificate
properties:
protectionResourceCertificateId: string
resource: string
sslCrt: string
sslKey: string
sslType: string
ProtectionResourceCertificate Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ProtectionResourceCertificate resource accepts the following input properties:
- Resource string
- The ID of DDoS protection resource to manage certificate for.
- Ssl
Type string - Select the SSL certificate type. Available values are
custom
,le
. - Protection
Resource stringCertificate Id - The ID of this resource.
- Ssl
Crt string - Public part of the SSL certificate. It is required add all chains. Each certificate chain should be separated by
\n
. - Ssl
Key string - Private key of the SSL certificate.
- Resource string
- The ID of DDoS protection resource to manage certificate for.
- Ssl
Type string - Select the SSL certificate type. Available values are
custom
,le
. - Protection
Resource stringCertificate Id - The ID of this resource.
- Ssl
Crt string - Public part of the SSL certificate. It is required add all chains. Each certificate chain should be separated by
\n
. - Ssl
Key string - Private key of the SSL certificate.
- resource String
- The ID of DDoS protection resource to manage certificate for.
- ssl
Type String - Select the SSL certificate type. Available values are
custom
,le
. - protection
Resource StringCertificate Id - The ID of this resource.
- ssl
Crt String - Public part of the SSL certificate. It is required add all chains. Each certificate chain should be separated by
\n
. - ssl
Key String - Private key of the SSL certificate.
- resource string
- The ID of DDoS protection resource to manage certificate for.
- ssl
Type string - Select the SSL certificate type. Available values are
custom
,le
. - protection
Resource stringCertificate Id - The ID of this resource.
- ssl
Crt string - Public part of the SSL certificate. It is required add all chains. Each certificate chain should be separated by
\n
. - ssl
Key string - Private key of the SSL certificate.
- resource str
- The ID of DDoS protection resource to manage certificate for.
- ssl_
type str - Select the SSL certificate type. Available values are
custom
,le
. - protection_
resource_ strcertificate_ id - The ID of this resource.
- ssl_
crt str - Public part of the SSL certificate. It is required add all chains. Each certificate chain should be separated by
\n
. - ssl_
key str - Private key of the SSL certificate.
- resource String
- The ID of DDoS protection resource to manage certificate for.
- ssl
Type String - Select the SSL certificate type. Available values are
custom
,le
. - protection
Resource StringCertificate Id - The ID of this resource.
- ssl
Crt String - Public part of the SSL certificate. It is required add all chains. Each certificate chain should be separated by
\n
. - ssl
Key String - Private key of the SSL certificate.
Outputs
All input properties are implicitly available as output properties. Additionally, the ProtectionResourceCertificate resource produces the following output properties:
- id str
- The provider-assigned unique ID for this managed resource.
- ssl_
expire float - UNIX timestamp of the SSL certificate expiration date.
- ssl_
status str - Let's Encrypt SSL certificate issuance status.
Look up Existing ProtectionResourceCertificate Resource
Get an existing ProtectionResourceCertificate resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ProtectionResourceCertificateState, opts?: CustomResourceOptions): ProtectionResourceCertificate
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
protection_resource_certificate_id: Optional[str] = None,
resource: Optional[str] = None,
ssl_crt: Optional[str] = None,
ssl_expire: Optional[float] = None,
ssl_key: Optional[str] = None,
ssl_status: Optional[str] = None,
ssl_type: Optional[str] = None) -> ProtectionResourceCertificate
func GetProtectionResourceCertificate(ctx *Context, name string, id IDInput, state *ProtectionResourceCertificateState, opts ...ResourceOption) (*ProtectionResourceCertificate, error)
public static ProtectionResourceCertificate Get(string name, Input<string> id, ProtectionResourceCertificateState? state, CustomResourceOptions? opts = null)
public static ProtectionResourceCertificate get(String name, Output<String> id, ProtectionResourceCertificateState state, CustomResourceOptions options)
resources: _: type: edgecenter:ProtectionResourceCertificate get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Protection
Resource stringCertificate Id - The ID of this resource.
- Resource string
- The ID of DDoS protection resource to manage certificate for.
- Ssl
Crt string - Public part of the SSL certificate. It is required add all chains. Each certificate chain should be separated by
\n
. - Ssl
Expire double - UNIX timestamp of the SSL certificate expiration date.
- Ssl
Key string - Private key of the SSL certificate.
- Ssl
Status string - Let's Encrypt SSL certificate issuance status.
- Ssl
Type string - Select the SSL certificate type. Available values are
custom
,le
.
- Protection
Resource stringCertificate Id - The ID of this resource.
- Resource string
- The ID of DDoS protection resource to manage certificate for.
- Ssl
Crt string - Public part of the SSL certificate. It is required add all chains. Each certificate chain should be separated by
\n
. - Ssl
Expire float64 - UNIX timestamp of the SSL certificate expiration date.
- Ssl
Key string - Private key of the SSL certificate.
- Ssl
Status string - Let's Encrypt SSL certificate issuance status.
- Ssl
Type string - Select the SSL certificate type. Available values are
custom
,le
.
- protection
Resource StringCertificate Id - The ID of this resource.
- resource String
- The ID of DDoS protection resource to manage certificate for.
- ssl
Crt String - Public part of the SSL certificate. It is required add all chains. Each certificate chain should be separated by
\n
. - ssl
Expire Double - UNIX timestamp of the SSL certificate expiration date.
- ssl
Key String - Private key of the SSL certificate.
- ssl
Status String - Let's Encrypt SSL certificate issuance status.
- ssl
Type String - Select the SSL certificate type. Available values are
custom
,le
.
- protection
Resource stringCertificate Id - The ID of this resource.
- resource string
- The ID of DDoS protection resource to manage certificate for.
- ssl
Crt string - Public part of the SSL certificate. It is required add all chains. Each certificate chain should be separated by
\n
. - ssl
Expire number - UNIX timestamp of the SSL certificate expiration date.
- ssl
Key string - Private key of the SSL certificate.
- ssl
Status string - Let's Encrypt SSL certificate issuance status.
- ssl
Type string - Select the SSL certificate type. Available values are
custom
,le
.
- protection_
resource_ strcertificate_ id - The ID of this resource.
- resource str
- The ID of DDoS protection resource to manage certificate for.
- ssl_
crt str - Public part of the SSL certificate. It is required add all chains. Each certificate chain should be separated by
\n
. - ssl_
expire float - UNIX timestamp of the SSL certificate expiration date.
- ssl_
key str - Private key of the SSL certificate.
- ssl_
status str - Let's Encrypt SSL certificate issuance status.
- ssl_
type str - Select the SSL certificate type. Available values are
custom
,le
.
- protection
Resource StringCertificate Id - The ID of this resource.
- resource String
- The ID of DDoS protection resource to manage certificate for.
- ssl
Crt String - Public part of the SSL certificate. It is required add all chains. Each certificate chain should be separated by
\n
. - ssl
Expire Number - UNIX timestamp of the SSL certificate expiration date.
- ssl
Key String - Private key of the SSL certificate.
- ssl
Status String - Let's Encrypt SSL certificate issuance status.
- ssl
Type String - Select the SSL certificate type. Available values are
custom
,le
.
Import
import using <resource_id> format
note: for “custom” type certificate and private key are not imported
$ pulumi import edgecenter:index/protectionResourceCertificate:ProtectionResourceCertificate protection_custom_cert 12345
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- edgecenter edge-center/terraform-provider-edgecenter
- License
- Notes
- This Pulumi package is based on the
edgecenter
Terraform Provider.