@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
124 lines • 5.69 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.SecurityScanConfig = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* A ScanConfig resource contains the configurations to launch a scan.
*
* To get more information about ScanConfig, see:
*
* * [API documentation](https://cloud.google.com/security-scanner/docs/reference/rest/v1beta/projects.scanConfigs)
* * How-to Guides
* * [Using Cloud Security Scanner](https://cloud.google.com/security-scanner/docs/scanning)
*
* ## Example Usage
*
* ### Scan Config Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const scannerStaticIp = new gcp.compute.Address("scanner_static_ip", {name: "scan-basic-static-ip"});
* const scan_config = new gcp.compute.SecurityScanConfig("scan-config", {
* displayName: "scan-config",
* startingUrls: [pulumi.interpolate`http://${scannerStaticIp.address}`],
* targetPlatforms: ["COMPUTE"],
* });
* ```
*
* ## Import
*
* ScanConfig can be imported using any of these accepted formats:
*
* * `{{project}}/{{name}}`
*
* * `{{project}} {{name}}`
*
* * `{{name}}`
*
* When using the `pulumi import` command, ScanConfig can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:compute/securityScanConfig:SecurityScanConfig default {{project}}/{{name}}
* ```
*
* ```sh
* $ pulumi import gcp:compute/securityScanConfig:SecurityScanConfig default "{{project}} {{name}}"
* ```
*
* ```sh
* $ pulumi import gcp:compute/securityScanConfig:SecurityScanConfig default {{name}}
* ```
*/
class SecurityScanConfig extends pulumi.CustomResource {
/**
* Get an existing SecurityScanConfig 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 SecurityScanConfig(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of SecurityScanConfig. 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'] === SecurityScanConfig.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["authentication"] = state ? state.authentication : undefined;
resourceInputs["blacklistPatterns"] = state ? state.blacklistPatterns : undefined;
resourceInputs["displayName"] = state ? state.displayName : undefined;
resourceInputs["exportToSecurityCommandCenter"] = state ? state.exportToSecurityCommandCenter : undefined;
resourceInputs["maxQps"] = state ? state.maxQps : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["schedule"] = state ? state.schedule : undefined;
resourceInputs["startingUrls"] = state ? state.startingUrls : undefined;
resourceInputs["targetPlatforms"] = state ? state.targetPlatforms : undefined;
resourceInputs["userAgent"] = state ? state.userAgent : undefined;
}
else {
const args = argsOrState;
if ((!args || args.displayName === undefined) && !opts.urn) {
throw new Error("Missing required property 'displayName'");
}
if ((!args || args.startingUrls === undefined) && !opts.urn) {
throw new Error("Missing required property 'startingUrls'");
}
resourceInputs["authentication"] = args ? args.authentication : undefined;
resourceInputs["blacklistPatterns"] = args ? args.blacklistPatterns : undefined;
resourceInputs["displayName"] = args ? args.displayName : undefined;
resourceInputs["exportToSecurityCommandCenter"] = args ? args.exportToSecurityCommandCenter : undefined;
resourceInputs["maxQps"] = args ? args.maxQps : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["schedule"] = args ? args.schedule : undefined;
resourceInputs["startingUrls"] = args ? args.startingUrls : undefined;
resourceInputs["targetPlatforms"] = args ? args.targetPlatforms : undefined;
resourceInputs["userAgent"] = args ? args.userAgent : undefined;
resourceInputs["name"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SecurityScanConfig.__pulumiType, name, resourceInputs, opts);
}
}
exports.SecurityScanConfig = SecurityScanConfig;
/** @internal */
SecurityScanConfig.__pulumiType = 'gcp:compute/securityScanConfig:SecurityScanConfig';
//# sourceMappingURL=securityScanConfig.js.map