cloudflare.ApiShieldSchema
Explore with Pulumi AI
Provides a resource to manage a schema in API Shield Schema Validation 2.0.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
import * as std from "@pulumi/std";
const petstoreSchema = new cloudflare.ApiShieldSchema("petstore_schema", {
zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
name: "myschema",
kind: "openapi_v3",
validationEnabled: true,
source: std.file({
input: "./schemas/petstore.json",
}).then(invoke => invoke.result),
});
import pulumi
import pulumi_cloudflare as cloudflare
import pulumi_std as std
petstore_schema = cloudflare.ApiShieldSchema("petstore_schema",
zone_id="0da42c8d2132a9ddaf714f9e7c920711",
name="myschema",
kind="openapi_v3",
validation_enabled=True,
source=std.file(input="./schemas/petstore.json").result)
package main
import (
"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
"github.com/pulumi/pulumi-std/sdk/go/std"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
invokeFile, err := std.File(ctx, &std.FileArgs{
Input: "./schemas/petstore.json",
}, nil)
if err != nil {
return err
}
_, err = cloudflare.NewApiShieldSchema(ctx, "petstore_schema", &cloudflare.ApiShieldSchemaArgs{
ZoneId: pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
Name: pulumi.String("myschema"),
Kind: pulumi.String("openapi_v3"),
ValidationEnabled: pulumi.Bool(true),
Source: pulumi.String(invokeFile.Result),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var petstoreSchema = new Cloudflare.ApiShieldSchema("petstore_schema", new()
{
ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
Name = "myschema",
Kind = "openapi_v3",
ValidationEnabled = true,
Source = Std.File.Invoke(new()
{
Input = "./schemas/petstore.json",
}).Apply(invoke => invoke.Result),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.ApiShieldSchema;
import com.pulumi.cloudflare.ApiShieldSchemaArgs;
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) {
var petstoreSchema = new ApiShieldSchema("petstoreSchema", ApiShieldSchemaArgs.builder()
.zoneId("0da42c8d2132a9ddaf714f9e7c920711")
.name("myschema")
.kind("openapi_v3")
.validationEnabled(true)
.source(StdFunctions.file(FileArgs.builder()
.input("./schemas/petstore.json")
.build()).result())
.build());
}
}
resources:
petstoreSchema:
type: cloudflare:ApiShieldSchema
name: petstore_schema
properties:
zoneId: 0da42c8d2132a9ddaf714f9e7c920711
name: myschema
kind: openapi_v3
validationEnabled: true # optional, default false
source:
fn::invoke:
Function: std:file
Arguments:
input: ./schemas/petstore.json
Return: result
Create ApiShieldSchema Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ApiShieldSchema(name: string, args: ApiShieldSchemaArgs, opts?: CustomResourceOptions);
@overload
def ApiShieldSchema(resource_name: str,
args: ApiShieldSchemaArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ApiShieldSchema(resource_name: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
source: Optional[str] = None,
zone_id: Optional[str] = None,
kind: Optional[str] = None,
validation_enabled: Optional[bool] = None)
func NewApiShieldSchema(ctx *Context, name string, args ApiShieldSchemaArgs, opts ...ResourceOption) (*ApiShieldSchema, error)
public ApiShieldSchema(string name, ApiShieldSchemaArgs args, CustomResourceOptions? opts = null)
public ApiShieldSchema(String name, ApiShieldSchemaArgs args)
public ApiShieldSchema(String name, ApiShieldSchemaArgs args, CustomResourceOptions options)
type: cloudflare:ApiShieldSchema
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 ApiShieldSchemaArgs
- 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 ApiShieldSchemaArgs
- 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 ApiShieldSchemaArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApiShieldSchemaArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApiShieldSchemaArgs
- 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 apiShieldSchemaResource = new Cloudflare.ApiShieldSchema("apiShieldSchemaResource", new()
{
Name = "string",
Source = "string",
ZoneId = "string",
Kind = "string",
ValidationEnabled = false,
});
example, err := cloudflare.NewApiShieldSchema(ctx, "apiShieldSchemaResource", &cloudflare.ApiShieldSchemaArgs{
Name: pulumi.String("string"),
Source: pulumi.String("string"),
ZoneId: pulumi.String("string"),
Kind: pulumi.String("string"),
ValidationEnabled: pulumi.Bool(false),
})
var apiShieldSchemaResource = new ApiShieldSchema("apiShieldSchemaResource", ApiShieldSchemaArgs.builder()
.name("string")
.source("string")
.zoneId("string")
.kind("string")
.validationEnabled(false)
.build());
api_shield_schema_resource = cloudflare.ApiShieldSchema("apiShieldSchemaResource",
name="string",
source="string",
zone_id="string",
kind="string",
validation_enabled=False)
const apiShieldSchemaResource = new cloudflare.ApiShieldSchema("apiShieldSchemaResource", {
name: "string",
source: "string",
zoneId: "string",
kind: "string",
validationEnabled: false,
});
type: cloudflare:ApiShieldSchema
properties:
kind: string
name: string
source: string
validationEnabled: false
zoneId: string
ApiShieldSchema 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 ApiShieldSchema resource accepts the following input properties:
- Name string
- Name of the schema. Modifying this attribute will force creation of a new resource.
- Source string
- Schema file bytes. Modifying this attribute will force creation of a new resource.
- Zone
Id string - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Kind string
- Kind of schema. Defaults to
openapi_v3
. Modifying this attribute will force creation of a new resource. - Validation
Enabled bool - Flag whether schema is enabled for validation.
- Name string
- Name of the schema. Modifying this attribute will force creation of a new resource.
- Source string
- Schema file bytes. Modifying this attribute will force creation of a new resource.
- Zone
Id string - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Kind string
- Kind of schema. Defaults to
openapi_v3
. Modifying this attribute will force creation of a new resource. - Validation
Enabled bool - Flag whether schema is enabled for validation.
- name String
- Name of the schema. Modifying this attribute will force creation of a new resource.
- source String
- Schema file bytes. Modifying this attribute will force creation of a new resource.
- zone
Id String - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- kind String
- Kind of schema. Defaults to
openapi_v3
. Modifying this attribute will force creation of a new resource. - validation
Enabled Boolean - Flag whether schema is enabled for validation.
- name string
- Name of the schema. Modifying this attribute will force creation of a new resource.
- source string
- Schema file bytes. Modifying this attribute will force creation of a new resource.
- zone
Id string - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- kind string
- Kind of schema. Defaults to
openapi_v3
. Modifying this attribute will force creation of a new resource. - validation
Enabled boolean - Flag whether schema is enabled for validation.
- name str
- Name of the schema. Modifying this attribute will force creation of a new resource.
- source str
- Schema file bytes. Modifying this attribute will force creation of a new resource.
- zone_
id str - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- kind str
- Kind of schema. Defaults to
openapi_v3
. Modifying this attribute will force creation of a new resource. - validation_
enabled bool - Flag whether schema is enabled for validation.
- name String
- Name of the schema. Modifying this attribute will force creation of a new resource.
- source String
- Schema file bytes. Modifying this attribute will force creation of a new resource.
- zone
Id String - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- kind String
- Kind of schema. Defaults to
openapi_v3
. Modifying this attribute will force creation of a new resource. - validation
Enabled Boolean - Flag whether schema is enabled for validation.
Outputs
All input properties are implicitly available as output properties. Additionally, the ApiShieldSchema resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ApiShieldSchema Resource
Get an existing ApiShieldSchema 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?: ApiShieldSchemaState, opts?: CustomResourceOptions): ApiShieldSchema
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
kind: Optional[str] = None,
name: Optional[str] = None,
source: Optional[str] = None,
validation_enabled: Optional[bool] = None,
zone_id: Optional[str] = None) -> ApiShieldSchema
func GetApiShieldSchema(ctx *Context, name string, id IDInput, state *ApiShieldSchemaState, opts ...ResourceOption) (*ApiShieldSchema, error)
public static ApiShieldSchema Get(string name, Input<string> id, ApiShieldSchemaState? state, CustomResourceOptions? opts = null)
public static ApiShieldSchema get(String name, Output<String> id, ApiShieldSchemaState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Kind string
- Kind of schema. Defaults to
openapi_v3
. Modifying this attribute will force creation of a new resource. - Name string
- Name of the schema. Modifying this attribute will force creation of a new resource.
- Source string
- Schema file bytes. Modifying this attribute will force creation of a new resource.
- Validation
Enabled bool - Flag whether schema is enabled for validation.
- Zone
Id string - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Kind string
- Kind of schema. Defaults to
openapi_v3
. Modifying this attribute will force creation of a new resource. - Name string
- Name of the schema. Modifying this attribute will force creation of a new resource.
- Source string
- Schema file bytes. Modifying this attribute will force creation of a new resource.
- Validation
Enabled bool - Flag whether schema is enabled for validation.
- Zone
Id string - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- kind String
- Kind of schema. Defaults to
openapi_v3
. Modifying this attribute will force creation of a new resource. - name String
- Name of the schema. Modifying this attribute will force creation of a new resource.
- source String
- Schema file bytes. Modifying this attribute will force creation of a new resource.
- validation
Enabled Boolean - Flag whether schema is enabled for validation.
- zone
Id String - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- kind string
- Kind of schema. Defaults to
openapi_v3
. Modifying this attribute will force creation of a new resource. - name string
- Name of the schema. Modifying this attribute will force creation of a new resource.
- source string
- Schema file bytes. Modifying this attribute will force creation of a new resource.
- validation
Enabled boolean - Flag whether schema is enabled for validation.
- zone
Id string - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- kind str
- Kind of schema. Defaults to
openapi_v3
. Modifying this attribute will force creation of a new resource. - name str
- Name of the schema. Modifying this attribute will force creation of a new resource.
- source str
- Schema file bytes. Modifying this attribute will force creation of a new resource.
- validation_
enabled bool - Flag whether schema is enabled for validation.
- zone_
id str - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- kind String
- Kind of schema. Defaults to
openapi_v3
. Modifying this attribute will force creation of a new resource. - name String
- Name of the schema. Modifying this attribute will force creation of a new resource.
- source String
- Schema file bytes. Modifying this attribute will force creation of a new resource.
- validation
Enabled Boolean - Flag whether schema is enabled for validation.
- zone
Id String - The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.
Package Details
- Repository
- Cloudflare pulumi/pulumi-cloudflare
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cloudflare
Terraform Provider.