1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. ApiShieldSchema
Cloudflare v6.0.1 published on Wednesday, Apr 16, 2025 by Pulumi

cloudflare.ApiShieldSchema

Explore with Pulumi AI

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

const exampleApiShieldSchema = new cloudflare.ApiShieldSchema("example_api_shield_schema", {
    zoneId: "023e105f4ecef8ad9ca31a8372d0c353",
    file: "file.txt",
    kind: "openapi_v3",
    name: "petstore schema",
    validationEnabled: "true",
});
Copy
import pulumi
import pulumi_cloudflare as cloudflare

example_api_shield_schema = cloudflare.ApiShieldSchema("example_api_shield_schema",
    zone_id="023e105f4ecef8ad9ca31a8372d0c353",
    file="file.txt",
    kind="openapi_v3",
    name="petstore schema",
    validation_enabled="true")
Copy
package main

import (
	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudflare.NewApiShieldSchema(ctx, "example_api_shield_schema", &cloudflare.ApiShieldSchemaArgs{
			ZoneId:            pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
			File:              pulumi.String("file.txt"),
			Kind:              pulumi.String("openapi_v3"),
			Name:              pulumi.String("petstore schema"),
			ValidationEnabled: pulumi.String("true"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

return await Deployment.RunAsync(() => 
{
    var exampleApiShieldSchema = new Cloudflare.ApiShieldSchema("example_api_shield_schema", new()
    {
        ZoneId = "023e105f4ecef8ad9ca31a8372d0c353",
        File = "file.txt",
        Kind = "openapi_v3",
        Name = "petstore schema",
        ValidationEnabled = "true",
    });

});
Copy
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 exampleApiShieldSchema = new ApiShieldSchema("exampleApiShieldSchema", ApiShieldSchemaArgs.builder()
            .zoneId("023e105f4ecef8ad9ca31a8372d0c353")
            .file("file.txt")
            .kind("openapi_v3")
            .name("petstore schema")
            .validationEnabled("true")
            .build());

    }
}
Copy
resources:
  exampleApiShieldSchema:
    type: cloudflare:ApiShieldSchema
    name: example_api_shield_schema
    properties:
      zoneId: 023e105f4ecef8ad9ca31a8372d0c353
      file: file.txt
      kind: openapi_v3
      name: petstore schema
      validationEnabled: 'true'
Copy

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,
                    file: Optional[str] = None,
                    kind: Optional[str] = None,
                    zone_id: Optional[str] = None,
                    name: Optional[str] = None,
                    schema_id: Optional[str] = None,
                    validation_enabled: Optional[str] = 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 This property is required. string
The unique name of the resource.
args This property is required. ApiShieldSchemaArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. ApiShieldSchemaArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ApiShieldSchemaArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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()
{
    File = "string",
    Kind = "string",
    ZoneId = "string",
    Name = "string",
    SchemaId = "string",
    ValidationEnabled = "string",
});
Copy
example, err := cloudflare.NewApiShieldSchema(ctx, "apiShieldSchemaResource", &cloudflare.ApiShieldSchemaArgs{
	File:              pulumi.String("string"),
	Kind:              pulumi.String("string"),
	ZoneId:            pulumi.String("string"),
	Name:              pulumi.String("string"),
	SchemaId:          pulumi.String("string"),
	ValidationEnabled: pulumi.String("string"),
})
Copy
var apiShieldSchemaResource = new ApiShieldSchema("apiShieldSchemaResource", ApiShieldSchemaArgs.builder()
    .file("string")
    .kind("string")
    .zoneId("string")
    .name("string")
    .schemaId("string")
    .validationEnabled("string")
    .build());
Copy
api_shield_schema_resource = cloudflare.ApiShieldSchema("apiShieldSchemaResource",
    file="string",
    kind="string",
    zone_id="string",
    name="string",
    schema_id="string",
    validation_enabled="string")
Copy
const apiShieldSchemaResource = new cloudflare.ApiShieldSchema("apiShieldSchemaResource", {
    file: "string",
    kind: "string",
    zoneId: "string",
    name: "string",
    schemaId: "string",
    validationEnabled: "string",
});
Copy
type: cloudflare:ApiShieldSchema
properties:
    file: string
    kind: string
    name: string
    schemaId: string
    validationEnabled: string
    zoneId: string
Copy

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:

File This property is required. string
Schema file bytes
Kind This property is required. string
Kind of schema Available values: "openapi_v3".
ZoneId This property is required. string
Identifier
Name string
Name of the schema
SchemaId string
ValidationEnabled string
Flag whether schema is enabled for validation. Available values: "true", "false".
File This property is required. string
Schema file bytes
Kind This property is required. string
Kind of schema Available values: "openapi_v3".
ZoneId This property is required. string
Identifier
Name string
Name of the schema
SchemaId string
ValidationEnabled string
Flag whether schema is enabled for validation. Available values: "true", "false".
file This property is required. String
Schema file bytes
kind This property is required. String
Kind of schema Available values: "openapi_v3".
zoneId This property is required. String
Identifier
name String
Name of the schema
schemaId String
validationEnabled String
Flag whether schema is enabled for validation. Available values: "true", "false".
file This property is required. string
Schema file bytes
kind This property is required. string
Kind of schema Available values: "openapi_v3".
zoneId This property is required. string
Identifier
name string
Name of the schema
schemaId string
validationEnabled string
Flag whether schema is enabled for validation. Available values: "true", "false".
file This property is required. str
Schema file bytes
kind This property is required. str
Kind of schema Available values: "openapi_v3".
zone_id This property is required. str
Identifier
name str
Name of the schema
schema_id str
validation_enabled str
Flag whether schema is enabled for validation. Available values: "true", "false".
file This property is required. String
Schema file bytes
kind This property is required. String
Kind of schema Available values: "openapi_v3".
zoneId This property is required. String
Identifier
name String
Name of the schema
schemaId String
validationEnabled String
Flag whether schema is enabled for validation. Available values: "true", "false".

Outputs

All input properties are implicitly available as output properties. Additionally, the ApiShieldSchema resource produces the following output properties:

CreatedAt string
Id string
The provider-assigned unique ID for this managed resource.
Schema ApiShieldSchemaSchema
Source string
Source of the schema
UploadDetails ApiShieldSchemaUploadDetails
CreatedAt string
Id string
The provider-assigned unique ID for this managed resource.
Schema ApiShieldSchemaSchema
Source string
Source of the schema
UploadDetails ApiShieldSchemaUploadDetails
createdAt String
id String
The provider-assigned unique ID for this managed resource.
schema ApiShieldSchemaSchema
source String
Source of the schema
uploadDetails ApiShieldSchemaUploadDetails
createdAt string
id string
The provider-assigned unique ID for this managed resource.
schema ApiShieldSchemaSchema
source string
Source of the schema
uploadDetails ApiShieldSchemaUploadDetails
created_at str
id str
The provider-assigned unique ID for this managed resource.
schema ApiShieldSchemaSchema
source str
Source of the schema
upload_details ApiShieldSchemaUploadDetails
createdAt String
id String
The provider-assigned unique ID for this managed resource.
schema Property Map
source String
Source of the schema
uploadDetails Property Map

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,
        created_at: Optional[str] = None,
        file: Optional[str] = None,
        kind: Optional[str] = None,
        name: Optional[str] = None,
        schema: Optional[ApiShieldSchemaSchemaArgs] = None,
        schema_id: Optional[str] = None,
        source: Optional[str] = None,
        upload_details: Optional[ApiShieldSchemaUploadDetailsArgs] = None,
        validation_enabled: Optional[str] = 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)
resources:  _:    type: cloudflare:ApiShieldSchema    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
CreatedAt string
File string
Schema file bytes
Kind string
Kind of schema Available values: "openapi_v3".
Name string
Name of the schema
Schema ApiShieldSchemaSchema
SchemaId string
Source string
Source of the schema
UploadDetails ApiShieldSchemaUploadDetails
ValidationEnabled string
Flag whether schema is enabled for validation. Available values: "true", "false".
ZoneId string
Identifier
CreatedAt string
File string
Schema file bytes
Kind string
Kind of schema Available values: "openapi_v3".
Name string
Name of the schema
Schema ApiShieldSchemaSchemaArgs
SchemaId string
Source string
Source of the schema
UploadDetails ApiShieldSchemaUploadDetailsArgs
ValidationEnabled string
Flag whether schema is enabled for validation. Available values: "true", "false".
ZoneId string
Identifier
createdAt String
file String
Schema file bytes
kind String
Kind of schema Available values: "openapi_v3".
name String
Name of the schema
schema ApiShieldSchemaSchema
schemaId String
source String
Source of the schema
uploadDetails ApiShieldSchemaUploadDetails
validationEnabled String
Flag whether schema is enabled for validation. Available values: "true", "false".
zoneId String
Identifier
createdAt string
file string
Schema file bytes
kind string
Kind of schema Available values: "openapi_v3".
name string
Name of the schema
schema ApiShieldSchemaSchema
schemaId string
source string
Source of the schema
uploadDetails ApiShieldSchemaUploadDetails
validationEnabled string
Flag whether schema is enabled for validation. Available values: "true", "false".
zoneId string
Identifier
created_at str
file str
Schema file bytes
kind str
Kind of schema Available values: "openapi_v3".
name str
Name of the schema
schema ApiShieldSchemaSchemaArgs
schema_id str
source str
Source of the schema
upload_details ApiShieldSchemaUploadDetailsArgs
validation_enabled str
Flag whether schema is enabled for validation. Available values: "true", "false".
zone_id str
Identifier
createdAt String
file String
Schema file bytes
kind String
Kind of schema Available values: "openapi_v3".
name String
Name of the schema
schema Property Map
schemaId String
source String
Source of the schema
uploadDetails Property Map
validationEnabled String
Flag whether schema is enabled for validation. Available values: "true", "false".
zoneId String
Identifier

Supporting Types

ApiShieldSchemaSchema
, ApiShieldSchemaSchemaArgs

CreatedAt string
Kind string
Kind of schema Available values: "openapi_v3".
Name string
Name of the schema
SchemaId string
UUID
Source string
Source of the schema
ValidationEnabled bool
Flag whether schema is enabled for validation.
CreatedAt string
Kind string
Kind of schema Available values: "openapi_v3".
Name string
Name of the schema
SchemaId string
UUID
Source string
Source of the schema
ValidationEnabled bool
Flag whether schema is enabled for validation.
createdAt String
kind String
Kind of schema Available values: "openapi_v3".
name String
Name of the schema
schemaId String
UUID
source String
Source of the schema
validationEnabled Boolean
Flag whether schema is enabled for validation.
createdAt string
kind string
Kind of schema Available values: "openapi_v3".
name string
Name of the schema
schemaId string
UUID
source string
Source of the schema
validationEnabled boolean
Flag whether schema is enabled for validation.
created_at str
kind str
Kind of schema Available values: "openapi_v3".
name str
Name of the schema
schema_id str
UUID
source str
Source of the schema
validation_enabled bool
Flag whether schema is enabled for validation.
createdAt String
kind String
Kind of schema Available values: "openapi_v3".
name String
Name of the schema
schemaId String
UUID
source String
Source of the schema
validationEnabled Boolean
Flag whether schema is enabled for validation.

ApiShieldSchemaUploadDetails
, ApiShieldSchemaUploadDetailsArgs

Warnings List<ApiShieldSchemaUploadDetailsWarning>
Diagnostic warning events that occurred during processing. These events are non-critical errors found within the schema.
Warnings []ApiShieldSchemaUploadDetailsWarning
Diagnostic warning events that occurred during processing. These events are non-critical errors found within the schema.
warnings List<ApiShieldSchemaUploadDetailsWarning>
Diagnostic warning events that occurred during processing. These events are non-critical errors found within the schema.
warnings ApiShieldSchemaUploadDetailsWarning[]
Diagnostic warning events that occurred during processing. These events are non-critical errors found within the schema.
warnings Sequence[ApiShieldSchemaUploadDetailsWarning]
Diagnostic warning events that occurred during processing. These events are non-critical errors found within the schema.
warnings List<Property Map>
Diagnostic warning events that occurred during processing. These events are non-critical errors found within the schema.

ApiShieldSchemaUploadDetailsWarning
, ApiShieldSchemaUploadDetailsWarningArgs

Code int
Code that identifies the event that occurred.
Locations List<string>
JSONPath location(s) in the schema where these events were encountered. See https://goessner.net/articles/JsonPath/ for JSONPath specification.
Message string
Diagnostic message that describes the event.
Code int
Code that identifies the event that occurred.
Locations []string
JSONPath location(s) in the schema where these events were encountered. See https://goessner.net/articles/JsonPath/ for JSONPath specification.
Message string
Diagnostic message that describes the event.
code Integer
Code that identifies the event that occurred.
locations List<String>
JSONPath location(s) in the schema where these events were encountered. See https://goessner.net/articles/JsonPath/ for JSONPath specification.
message String
Diagnostic message that describes the event.
code number
Code that identifies the event that occurred.
locations string[]
JSONPath location(s) in the schema where these events were encountered. See https://goessner.net/articles/JsonPath/ for JSONPath specification.
message string
Diagnostic message that describes the event.
code int
Code that identifies the event that occurred.
locations Sequence[str]
JSONPath location(s) in the schema where these events were encountered. See https://goessner.net/articles/JsonPath/ for JSONPath specification.
message str
Diagnostic message that describes the event.
code Number
Code that identifies the event that occurred.
locations List<String>
JSONPath location(s) in the schema where these events were encountered. See https://goessner.net/articles/JsonPath/ for JSONPath specification.
message String
Diagnostic message that describes the event.

Package Details

Repository
Cloudflare pulumi/pulumi-cloudflare
License
Apache-2.0
Notes
This Pulumi package is based on the cloudflare Terraform Provider.