@pulumi/scm
Version:
A Pulumi package for managing resources on Strata Cloud Manager.. Based on terraform-provider-scm: version v0.2.1
169 lines • 6.79 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ServiceConnection = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ServiceConnection resource
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scm from "@pulumi/scm";
*
* const config = new pulumi.Config();
* // The folder scope for the SCM resource (e.g., 'Shared', 'Predefined', or a specific folder name).
* const folderScope = config.get("folderScope") || "Service Connections";
* //# 1. Define the IKE Crypto Profile (IKE Phase 1)
* // Note: The resource name is plural: "scm_ike_crypto_profile"
* const example = new scm.IkeCryptoProfile("example", {
* name: "example-ike-crypto",
* folder: folderScope,
* hashes: ["sha256"],
* dhGroups: ["group14"],
* encryptions: ["aes-256-cbc"],
* });
* //# 2. Define the IPsec Crypto Profile (IKE Phase 2)
* // Note: The resource name is plural and nested blocks now use an equals sign (=).
* const exampleIpsecCryptoProfile = new scm.IpsecCryptoProfile("example", {
* name: "panw-IPSec-Crypto",
* folder: folderScope,
* esp: {
* encryptions: ["aes-256-gcm"],
* authentications: ["sha256"],
* },
* dhGroup: "group14",
* lifetime: {
* hours: 8,
* },
* });
* //# 3. Define the IKE Gateway
* // Note: The resource name is plural and nested blocks now use an equals sign (=).
* const exampleIkeGateway = new scm.IkeGateway("example", {
* name: "example-gateway",
* folder: folderScope,
* peerAddress: {
* ip: "1.1.1.1",
* },
* authentication: {
* preSharedKey: {
* key: "secret",
* },
* },
* protocol: {
* ikev1: {
* ikeCryptoProfile: example.name,
* },
* },
* });
* //# 4. Define the IPsec Tunnel
* // Note: Nested 'auto_key' block uses an equals sign (=).
* const exampleIpsecTunnel = new scm.IpsecTunnel("example", {
* name: "example-tunnel",
* folder: folderScope,
* tunnelInterface: "tunnel",
* antiReplay: true,
* copyTos: false,
* enableGreEncapsulation: false,
* autoKey: {
* ikeGateways: [{
* name: exampleIkeGateway.name,
* }],
* ipsecCryptoProfile: exampleIpsecCryptoProfile.name,
* },
* }, {
* dependsOn: [exampleIkeGateway],
* });
* const siteAVpnSc = new scm.ServiceConnection("site_a_vpn_sc", {
* name: "creating_a_service_connection",
* region: "us-west-1",
* ipsecTunnel: exampleIpsecTunnel.name,
* subnets: [
* "10.1.0.0/16",
* "172.16.0.0/24",
* ],
* sourceNat: true,
* });
* ```
*/
class ServiceConnection extends pulumi.CustomResource {
/**
* Get an existing ServiceConnection resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new ServiceConnection(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ServiceConnection. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === ServiceConnection.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["backupSc"] = state?.backupSc;
resourceInputs["bgpPeer"] = state?.bgpPeer;
resourceInputs["encryptedValues"] = state?.encryptedValues;
resourceInputs["ipsecTunnel"] = state?.ipsecTunnel;
resourceInputs["name"] = state?.name;
resourceInputs["natPool"] = state?.natPool;
resourceInputs["noExportCommunity"] = state?.noExportCommunity;
resourceInputs["onboardingType"] = state?.onboardingType;
resourceInputs["protocol"] = state?.protocol;
resourceInputs["qos"] = state?.qos;
resourceInputs["region"] = state?.region;
resourceInputs["secondaryIpsecTunnel"] = state?.secondaryIpsecTunnel;
resourceInputs["sourceNat"] = state?.sourceNat;
resourceInputs["subnets"] = state?.subnets;
resourceInputs["tfid"] = state?.tfid;
}
else {
const args = argsOrState;
if (args?.ipsecTunnel === undefined && !opts.urn) {
throw new Error("Missing required property 'ipsecTunnel'");
}
if (args?.region === undefined && !opts.urn) {
throw new Error("Missing required property 'region'");
}
resourceInputs["backupSc"] = args?.backupSc;
resourceInputs["bgpPeer"] = args?.bgpPeer;
resourceInputs["ipsecTunnel"] = args?.ipsecTunnel;
resourceInputs["name"] = args?.name;
resourceInputs["natPool"] = args?.natPool;
resourceInputs["noExportCommunity"] = args?.noExportCommunity;
resourceInputs["onboardingType"] = args?.onboardingType;
resourceInputs["protocol"] = args?.protocol;
resourceInputs["qos"] = args?.qos;
resourceInputs["region"] = args?.region;
resourceInputs["secondaryIpsecTunnel"] = args?.secondaryIpsecTunnel;
resourceInputs["sourceNat"] = args?.sourceNat;
resourceInputs["subnets"] = args?.subnets;
resourceInputs["encryptedValues"] = undefined /*out*/;
resourceInputs["tfid"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["encryptedValues"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(ServiceConnection.__pulumiType, name, resourceInputs, opts);
}
}
exports.ServiceConnection = ServiceConnection;
/** @internal */
ServiceConnection.__pulumiType = 'scm:index/serviceConnection:ServiceConnection';
//# sourceMappingURL=serviceConnection.js.map