1. Packages
  2. Routeros Provider
  3. API Docs
  4. getX509
routeros 1.91.0 published on Monday, Nov 10, 2025 by terraform-routeros
routeros logo
routeros 1.91.0 published on Monday, Nov 10, 2025 by terraform-routeros

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as routeros from "@pulumi/routeros";
    
    // You can keep indents in front of the content lines of the certificate.
    // The normalized certificate is available through the `pem` attribute
    const cert = routeros.getX509({
        data: `\\t-----BEGIN CERTIFICATE-----
    \\tMIIBlTCCATugAwIBAgIINLsws71B5zIwCgYIKoZIzj0EAwIwHzEdMBsGA1UEAwwU
    \\tRXh0ZXJuYWwgQ2VydGlmaWNhdGUwHhcNMjQwNTE3MjEyOTUzWhcNMjUwNTE3MjEy
    \\tOTUzWjAfMR0wGwYDVQQDDBRFeHRlcm5hbCBDZXJ0aWZpY2F0ZTBZMBMGByqGSM49
    \\tAgEGCCqGSM49AwEHA0IABKE1g0Qj4ujIold9tklu2z4BUu/K7xDFF5YmedtOfJyM
    \\t1/80APNboqn71y4m4XNE1JNtQuR2bSZPHVrzODkR16ujYTBfMA8GA1UdEwEB/wQF
    \\tMAMBAf8wDgYDVR0PAQH/BAQDAgG2MB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEF
    \\tBQcDAjAdBgNVHQ4EFgQUNXd5bvluIV9YAhGc5yMHc6OzXpMwCgYIKoZIzj0EAwID
    \\tSAAwRQIhAODte/qS6CE30cvnQpxP/ObWBPIPZnHtkFHIIC1AOSXwAiBGCGQE+aJY
    \\tW72Rw0Y1ckvlt6sU0urkzGuj5wxVF/gSYA==
    \\t-----END CERTIFICATE-----
    `,
    });
    
    import pulumi
    import pulumi_routeros as routeros
    
    # You can keep indents in front of the content lines of the certificate.
    # The normalized certificate is available through the `pem` attribute
    cert = routeros.get_x509(data="""\t-----BEGIN CERTIFICATE-----
    \tMIIBlTCCATugAwIBAgIINLsws71B5zIwCgYIKoZIzj0EAwIwHzEdMBsGA1UEAwwU
    \tRXh0ZXJuYWwgQ2VydGlmaWNhdGUwHhcNMjQwNTE3MjEyOTUzWhcNMjUwNTE3MjEy
    \tOTUzWjAfMR0wGwYDVQQDDBRFeHRlcm5hbCBDZXJ0aWZpY2F0ZTBZMBMGByqGSM49
    \tAgEGCCqGSM49AwEHA0IABKE1g0Qj4ujIold9tklu2z4BUu/K7xDFF5YmedtOfJyM
    \t1/80APNboqn71y4m4XNE1JNtQuR2bSZPHVrzODkR16ujYTBfMA8GA1UdEwEB/wQF
    \tMAMBAf8wDgYDVR0PAQH/BAQDAgG2MB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEF
    \tBQcDAjAdBgNVHQ4EFgQUNXd5bvluIV9YAhGc5yMHc6OzXpMwCgYIKoZIzj0EAwID
    \tSAAwRQIhAODte/qS6CE30cvnQpxP/ObWBPIPZnHtkFHIIC1AOSXwAiBGCGQE+aJY
    \tW72Rw0Y1ckvlt6sU0urkzGuj5wxVF/gSYA==
    \t-----END CERTIFICATE-----
    """)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/routeros/routeros"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// You can keep indents in front of the content lines of the certificate.
    		// The normalized certificate is available through the `pem` attribute
    		_, err := routeros.GetX509(ctx, &routeros.GetX509Args{
    			Data: `\t-----BEGIN CERTIFICATE-----
    \tMIIBlTCCATugAwIBAgIINLsws71B5zIwCgYIKoZIzj0EAwIwHzEdMBsGA1UEAwwU
    \tRXh0ZXJuYWwgQ2VydGlmaWNhdGUwHhcNMjQwNTE3MjEyOTUzWhcNMjUwNTE3MjEy
    \tOTUzWjAfMR0wGwYDVQQDDBRFeHRlcm5hbCBDZXJ0aWZpY2F0ZTBZMBMGByqGSM49
    \tAgEGCCqGSM49AwEHA0IABKE1g0Qj4ujIold9tklu2z4BUu/K7xDFF5YmedtOfJyM
    \t1/80APNboqn71y4m4XNE1JNtQuR2bSZPHVrzODkR16ujYTBfMA8GA1UdEwEB/wQF
    \tMAMBAf8wDgYDVR0PAQH/BAQDAgG2MB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEF
    \tBQcDAjAdBgNVHQ4EFgQUNXd5bvluIV9YAhGc5yMHc6OzXpMwCgYIKoZIzj0EAwID
    \tSAAwRQIhAODte/qS6CE30cvnQpxP/ObWBPIPZnHtkFHIIC1AOSXwAiBGCGQE+aJY
    \tW72Rw0Y1ckvlt6sU0urkzGuj5wxVF/gSYA==
    \t-----END CERTIFICATE-----
    `,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Routeros = Pulumi.Routeros;
    
    return await Deployment.RunAsync(() => 
    {
        // You can keep indents in front of the content lines of the certificate.
        // The normalized certificate is available through the `pem` attribute
        var cert = Routeros.GetX509.Invoke(new()
        {
            Data = @"\t-----BEGIN CERTIFICATE-----
    \tMIIBlTCCATugAwIBAgIINLsws71B5zIwCgYIKoZIzj0EAwIwHzEdMBsGA1UEAwwU
    \tRXh0ZXJuYWwgQ2VydGlmaWNhdGUwHhcNMjQwNTE3MjEyOTUzWhcNMjUwNTE3MjEy
    \tOTUzWjAfMR0wGwYDVQQDDBRFeHRlcm5hbCBDZXJ0aWZpY2F0ZTBZMBMGByqGSM49
    \tAgEGCCqGSM49AwEHA0IABKE1g0Qj4ujIold9tklu2z4BUu/K7xDFF5YmedtOfJyM
    \t1/80APNboqn71y4m4XNE1JNtQuR2bSZPHVrzODkR16ujYTBfMA8GA1UdEwEB/wQF
    \tMAMBAf8wDgYDVR0PAQH/BAQDAgG2MB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEF
    \tBQcDAjAdBgNVHQ4EFgQUNXd5bvluIV9YAhGc5yMHc6OzXpMwCgYIKoZIzj0EAwID
    \tSAAwRQIhAODte/qS6CE30cvnQpxP/ObWBPIPZnHtkFHIIC1AOSXwAiBGCGQE+aJY
    \tW72Rw0Y1ckvlt6sU0urkzGuj5wxVF/gSYA==
    \t-----END CERTIFICATE-----
    ",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.routeros.RouterosFunctions;
    import com.pulumi.routeros.inputs.GetX509Args;
    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) {
            // You can keep indents in front of the content lines of the certificate.
            // The normalized certificate is available through the `pem` attribute
            final var cert = RouterosFunctions.getX509(GetX509Args.builder()
                .data("""
    \t-----BEGIN CERTIFICATE-----
    \tMIIBlTCCATugAwIBAgIINLsws71B5zIwCgYIKoZIzj0EAwIwHzEdMBsGA1UEAwwU
    \tRXh0ZXJuYWwgQ2VydGlmaWNhdGUwHhcNMjQwNTE3MjEyOTUzWhcNMjUwNTE3MjEy
    \tOTUzWjAfMR0wGwYDVQQDDBRFeHRlcm5hbCBDZXJ0aWZpY2F0ZTBZMBMGByqGSM49
    \tAgEGCCqGSM49AwEHA0IABKE1g0Qj4ujIold9tklu2z4BUu/K7xDFF5YmedtOfJyM
    \t1/80APNboqn71y4m4XNE1JNtQuR2bSZPHVrzODkR16ujYTBfMA8GA1UdEwEB/wQF
    \tMAMBAf8wDgYDVR0PAQH/BAQDAgG2MB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEF
    \tBQcDAjAdBgNVHQ4EFgQUNXd5bvluIV9YAhGc5yMHc6OzXpMwCgYIKoZIzj0EAwID
    \tSAAwRQIhAODte/qS6CE30cvnQpxP/ObWBPIPZnHtkFHIIC1AOSXwAiBGCGQE+aJY
    \tW72Rw0Y1ckvlt6sU0urkzGuj5wxVF/gSYA==
    \t-----END CERTIFICATE-----
                """)
                .build());
    
        }
    }
    
    variables:
      # You can keep indents in front of the content lines of the certificate.
      # The normalized certificate is available through the `pem` attribute
      cert:
        fn::invoke:
          function: routeros:getX509
          arguments:
            data: |
              \t-----BEGIN CERTIFICATE-----
              \tMIIBlTCCATugAwIBAgIINLsws71B5zIwCgYIKoZIzj0EAwIwHzEdMBsGA1UEAwwU
              \tRXh0ZXJuYWwgQ2VydGlmaWNhdGUwHhcNMjQwNTE3MjEyOTUzWhcNMjUwNTE3MjEy
              \tOTUzWjAfMR0wGwYDVQQDDBRFeHRlcm5hbCBDZXJ0aWZpY2F0ZTBZMBMGByqGSM49
              \tAgEGCCqGSM49AwEHA0IABKE1g0Qj4ujIold9tklu2z4BUu/K7xDFF5YmedtOfJyM
              \t1/80APNboqn71y4m4XNE1JNtQuR2bSZPHVrzODkR16ujYTBfMA8GA1UdEwEB/wQF
              \tMAMBAf8wDgYDVR0PAQH/BAQDAgG2MB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEF
              \tBQcDAjAdBgNVHQ4EFgQUNXd5bvluIV9YAhGc5yMHc6OzXpMwCgYIKoZIzj0EAwID
              \tSAAwRQIhAODte/qS6CE30cvnQpxP/ObWBPIPZnHtkFHIIC1AOSXwAiBGCGQE+aJY
              \tW72Rw0Y1ckvlt6sU0urkzGuj5wxVF/gSYA==
              \t-----END CERTIFICATE-----          
    

    Using getX509

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getX509(args: GetX509Args, opts?: InvokeOptions): Promise<GetX509Result>
    function getX509Output(args: GetX509OutputArgs, opts?: InvokeOptions): Output<GetX509Result>
    def get_x509(data: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetX509Result
    def get_x509_output(data: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetX509Result]
    func GetX509(ctx *Context, args *GetX509Args, opts ...InvokeOption) (*GetX509Result, error)
    func GetX509Output(ctx *Context, args *GetX509OutputArgs, opts ...InvokeOption) GetX509ResultOutput

    > Note: This function is named GetX509 in the Go SDK.

    public static class GetX509 
    {
        public static Task<GetX509Result> InvokeAsync(GetX509Args args, InvokeOptions? opts = null)
        public static Output<GetX509Result> Invoke(GetX509InvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetX509Result> getX509(GetX509Args args, InvokeOptions options)
    public static Output<GetX509Result> getX509(GetX509Args args, InvokeOptions options)
    
    fn::invoke:
      function: routeros:index/getX509:getX509
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Data string
    X509 certificate in PEM format.
    Data string
    X509 certificate in PEM format.
    data String
    X509 certificate in PEM format.
    data string
    X509 certificate in PEM format.
    data str
    X509 certificate in PEM format.
    data String
    X509 certificate in PEM format.

    getX509 Result

    The following output properties are available:

    Akid string
    Authority bool
    CommonName string
    Data string
    X509 certificate in PEM format.
    DigestAlgorithm string
    Fingerprint string
    Id string
    The ID of this resource.
    InvalidAfter string
    InvalidBefore string
    Issuer string
    KeyType string
    Pem string
    SerialNumber string
    SignatureAlgorithm string
    Skid string
    Subject string
    SubjectAltName string
    Version double
    Akid string
    Authority bool
    CommonName string
    Data string
    X509 certificate in PEM format.
    DigestAlgorithm string
    Fingerprint string
    Id string
    The ID of this resource.
    InvalidAfter string
    InvalidBefore string
    Issuer string
    KeyType string
    Pem string
    SerialNumber string
    SignatureAlgorithm string
    Skid string
    Subject string
    SubjectAltName string
    Version float64
    akid String
    authority Boolean
    commonName String
    data String
    X509 certificate in PEM format.
    digestAlgorithm String
    fingerprint String
    id String
    The ID of this resource.
    invalidAfter String
    invalidBefore String
    issuer String
    keyType String
    pem String
    serialNumber String
    signatureAlgorithm String
    skid String
    subject String
    subjectAltName String
    version Double
    akid string
    authority boolean
    commonName string
    data string
    X509 certificate in PEM format.
    digestAlgorithm string
    fingerprint string
    id string
    The ID of this resource.
    invalidAfter string
    invalidBefore string
    issuer string
    keyType string
    pem string
    serialNumber string
    signatureAlgorithm string
    skid string
    subject string
    subjectAltName string
    version number
    akid str
    authority bool
    common_name str
    data str
    X509 certificate in PEM format.
    digest_algorithm str
    fingerprint str
    id str
    The ID of this resource.
    invalid_after str
    invalid_before str
    issuer str
    key_type str
    pem str
    serial_number str
    signature_algorithm str
    skid str
    subject str
    subject_alt_name str
    version float
    akid String
    authority Boolean
    commonName String
    data String
    X509 certificate in PEM format.
    digestAlgorithm String
    fingerprint String
    id String
    The ID of this resource.
    invalidAfter String
    invalidBefore String
    issuer String
    keyType String
    pem String
    serialNumber String
    signatureAlgorithm String
    skid String
    subject String
    subjectAltName String
    version Number

    Package Details

    Repository
    routeros terraform-routeros/terraform-provider-routeros
    License
    Notes
    This Pulumi package is based on the routeros Terraform Provider.
    routeros logo
    routeros 1.91.0 published on Monday, Nov 10, 2025 by terraform-routeros
      Meet Neo: Your AI Platform Teammate