Many policy types rely on resources. Resources are the files that implement the code or configuration to be executed by a policy when attached to an API proxy or shared flow. For more information, examples of resources, and a list of supported resource types, see About resources.
Create resources at the API proxy, shared flow, or environment level and then access them from the policy, as described in the following sections. See also Managing folders and files in an Apigee workspace.
Creating a resource
To create a resource using Apigee in Cloud Code:
In your Apigee workspace, perform one of the following actions based on the level at which you want to store the resource. For more information, see Where resources are stored.
Level
Step
API proxy
Perform one of the following actions:
Position your cursor over one of the following folders, click , and select Create resource:
apiproxy-name proxy bundle
apiproxy-name/apiproxy
Position your cursor over the apiproxy-name/apiproxy/resources folder for the API proxy and click .
Shared flow
Perform one of the following actions:
Position your cursor over one of the following folders, click , and select Create resource:
sharedflow-name shared flow bundle
sharedflow-name/sharedflowbundle
Position your cursor over the sharedflow-name/sharedflowbundle/resources folder for the shared flow and click .
Environment
Perform one of the following actions:
Position your cursor over the env-name environment folder, click , and select Create resource.
Position your cursor over the env-name/resources folder for the environment and click .
The Create resource wizard opens.
Select the resource type that you want to create from the list. For a description of the resource types supported, see Resource types.
Enter a unique name for the resource and press Enter.
The resource is added to the resources folder in the apiproxies, sharedflows, or environments folder in the Apigee section and opened for editing.
Edit the resource file, as required, and select File > Save or ⌘S to save your edits.
Importing a resource
To import a resource using Apigee in Cloud Code:
In your Apigee workspace, perform one of the following actions based on the level at which you want to use the resource. For more information, see Where resources are stored.
Level
Step
API proxy
Perform one of the following actions:
Position your cursor over the apiproxy-name/apiproxy folder and click .
Position your cursor over the apiproxy-name/apiproxy/resources folder for the API proxy and click .
Shared flow
Perform one of the following actions:
Position your cursor over the sharedflow-name/sharedflowbundle folder and click .
Position your cursor over the sharedflow-name/sharedflowbundle/resources folder for the shared flow and click .
Environment
Perform one of the following actions:
Position your cursor over the env-name environment folder and click .
Position your cursor over the env-name/resources folder for the environment and click .
The Import resource wizard opens.
Select the resource type that you want to import from the list. For a description of the resource types supported, see Resource types.
Navigate to the file in your local directory and click Import.
Enter a unique name for the resource and press Enter.
The resource is added to the resources folder in the Apigee Explorer and opened for editing.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-24 UTC."],[[["This guide provides instructions for creating and importing resources in Apigee and Apigee hybrid, which are files used by policies in API proxies or shared flows."],["Resources can be created or imported at the API proxy, shared flow, or environment level within the Apigee workspace using the \"Create resource\" or \"Import resource\" wizards."],["When creating or importing resources, you must select the appropriate resource type, and the file extension is automatically appended based on the type selected."],["Resources are stored in the `resources` folder within the respective `apiproxies`, `sharedflows`, or `environments` folder in the Apigee section, and the method of accessing them from a policy varies depending on the resource type."]]],[]]