@lbrlabs/pulumi-scaleway
Version:
A Pulumi package for creating and managing scaleway cloud resources.
90 lines • 4.15 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.InstanceSecurityGroupRules = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Creates and manages Scaleway Compute Instance security group rules. For more information, see [the documentation](https://developers.scaleway.com/en/products/instance/api/#security-groups-8d7f89).
*
* This resource can be used to externalize rules from a `scaleway.InstanceSecurityGroup` to solve circular dependency problems. When using this resource do not forget to set `externalRules = true` on the security group.
*
* > **Warning:** In order to guaranty rules order in a given security group only one scaleway.InstanceSecurityGroupRules is allowed per security group.
*
* ## Examples
*
* ### Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as scaleway from "@lbrlabs/pulumi-scaleway";
*
* const sg01 = new scaleway.InstanceSecurityGroup("sg01", {externalRules: true});
* const sgrs01 = new scaleway.InstanceSecurityGroupRules("sgrs01", {
* securityGroupId: sg01.id,
* inboundRules: [{
* action: "accept",
* port: 80,
* ipRange: "0.0.0.0/0",
* }],
* });
* ```
*
* ## Import
*
* Instance security group rules can be imported using the `{zone}/{id}`, e.g. bash
*
* ```sh
* $ pulumi import scaleway:index/instanceSecurityGroupRules:InstanceSecurityGroupRules web fr-par-1/11111111-1111-1111-1111-111111111111
* ```
*/
class InstanceSecurityGroupRules extends pulumi.CustomResource {
/**
* Get an existing InstanceSecurityGroupRules 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 InstanceSecurityGroupRules(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of InstanceSecurityGroupRules. 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'] === InstanceSecurityGroupRules.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["inboundRules"] = state ? state.inboundRules : undefined;
resourceInputs["outboundRules"] = state ? state.outboundRules : undefined;
resourceInputs["securityGroupId"] = state ? state.securityGroupId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.securityGroupId === undefined) && !opts.urn) {
throw new Error("Missing required property 'securityGroupId'");
}
resourceInputs["inboundRules"] = args ? args.inboundRules : undefined;
resourceInputs["outboundRules"] = args ? args.outboundRules : undefined;
resourceInputs["securityGroupId"] = args ? args.securityGroupId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(InstanceSecurityGroupRules.__pulumiType, name, resourceInputs, opts);
}
}
exports.InstanceSecurityGroupRules = InstanceSecurityGroupRules;
/** @internal */
InstanceSecurityGroupRules.__pulumiType = 'scaleway:index/instanceSecurityGroupRules:InstanceSecurityGroupRules';
//# sourceMappingURL=instanceSecurityGroupRules.js.map