akamai.getPropertyRulesTemplate
Attributes reference
This data source returns this attribute:
json
- The fully expanded template with variables and all nested templates resolved.
Example Usage
Single JSON template that calls other templates
using System.Collections.Generic;
using Pulumi;
return await Deployment.RunAsync(() =>
{
});
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
}
}
import pulumi
import * as pulumi from "@pulumi/pulumi";
{}
Individual JSON rule template file
using System.Collections.Generic;
using Pulumi;
return await Deployment.RunAsync(() =>
{
});
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
}
}
import pulumi
import * as pulumi from "@pulumi/pulumi";
{}
Call individual template files with this data source
using System.Collections.Generic;
using System.Text.Json;
using Pulumi;
using Akamai = Pulumi.Akamai;
return await Deployment.RunAsync(() =>
{
var examplePropertyRulesTemplate = Akamai.GetPropertyRulesTemplate.Invoke(new()
{
Templates = new[]
{
new Akamai.Inputs.GetPropertyRulesTemplateTemplateInputArgs
{
TemplateData = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["rules"] = new Dictionary<string, object?>
{
["name"] = "default",
["children"] = new[]
{
"#include:rules.json",
},
},
}),
TemplateDir = "property-snippets/",
},
},
});
var exampleProperty = new Akamai.Property("exampleProperty", new()
{
ContractId = @var.Contractid,
GroupId = @var.Groupid,
RuleFormat = "v2020-03-04",
Rules = examplePropertyRulesTemplate.Apply(getPropertyRulesTemplateResult => getPropertyRulesTemplateResult.Json),
});
});
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-akamai/sdk/v4/go/akamai"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"rules": map[string]interface{}{
"name": "default",
"children": []string{
"#include:rules.json",
},
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
examplePropertyRulesTemplate, err := akamai.GetPropertyRulesTemplate(ctx, &akamai.GetPropertyRulesTemplateArgs{
Templates: []akamai.GetPropertyRulesTemplateTemplate{
{
TemplateData: json0,
TemplateDir: "property-snippets/",
},
},
}, nil)
if err != nil {
return err
}
_, err = akamai.NewProperty(ctx, "exampleProperty", &akamai.PropertyArgs{
ContractId: pulumi.Any(_var.Contractid),
GroupId: pulumi.Any(_var.Groupid),
RuleFormat: pulumi.String("v2020-03-04"),
Rules: *pulumi.String(examplePropertyRulesTemplate.Json),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.akamai.AkamaiFunctions;
import com.pulumi.akamai.inputs.GetPropertyRulesTemplateArgs;
import com.pulumi.akamai.Property;
import com.pulumi.akamai.PropertyArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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) {
final var examplePropertyRulesTemplate = AkamaiFunctions.getPropertyRulesTemplate(GetPropertyRulesTemplateArgs.builder()
.templates(GetPropertyRulesTemplateTemplateArgs.builder()
.templateData(serializeJson(
jsonObject(
jsonProperty("rules", jsonObject(
jsonProperty("name", "default"),
jsonProperty("children", jsonArray("#include:rules.json"))
))
)))
.templateDir("property-snippets/")
.build())
.build());
var exampleProperty = new Property("exampleProperty", PropertyArgs.builder()
.contractId(var_.contractid())
.groupId(var_.groupid())
.ruleFormat("v2020-03-04")
.rules(examplePropertyRulesTemplate.applyValue(getPropertyRulesTemplateResult -> getPropertyRulesTemplateResult.json()))
.build());
}
}
import pulumi
import json
import pulumi_akamai as akamai
example_property_rules_template = akamai.get_property_rules_template(templates=[akamai.GetPropertyRulesTemplateTemplateArgs(
template_data=json.dumps({
"rules": {
"name": "default",
"children": ["#include:rules.json"],
},
}),
template_dir="property-snippets/",
)])
example_property = akamai.Property("exampleProperty",
contract_id=var["contractid"],
group_id=var["groupid"],
rule_format="v2020-03-04",
rules=example_property_rules_template.json)
import * as pulumi from "@pulumi/pulumi";
import * as akamai from "@pulumi/akamai";
const examplePropertyRulesTemplate = akamai.getPropertyRulesTemplate({
templates: [{
templateData: JSON.stringify({
rules: {
name: "default",
children: ["#include:rules.json"],
},
}),
templateDir: "property-snippets/",
}],
});
const exampleProperty = new akamai.Property("exampleProperty", {
contractId: _var.contractid,
groupId: _var.groupid,
ruleFormat: "v2020-03-04",
rules: examplePropertyRulesTemplate.then(examplePropertyRulesTemplate => examplePropertyRulesTemplate.json),
});
resources:
exampleProperty:
type: akamai:Property
properties:
contractId: ${var.contractid}
groupId: ${var.groupid}
ruleFormat: v2020-03-04
rules: ${examplePropertyRulesTemplate.json}
variables:
examplePropertyRulesTemplate:
fn::invoke:
Function: akamai:getPropertyRulesTemplate
Arguments:
templates:
- templateData:
fn::toJSON:
rules:
name: default
children:
- '#include:rules.json'
templateDir: property-snippets/
Using getPropertyRulesTemplate
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getPropertyRulesTemplate(args: GetPropertyRulesTemplateArgs, opts?: InvokeOptions): Promise<GetPropertyRulesTemplateResult>
function getPropertyRulesTemplateOutput(args: GetPropertyRulesTemplateOutputArgs, opts?: InvokeOptions): Output<GetPropertyRulesTemplateResult>
def get_property_rules_template(template_file: Optional[str] = None,
templates: Optional[Sequence[GetPropertyRulesTemplateTemplate]] = None,
var_definition_file: Optional[str] = None,
var_values_file: Optional[str] = None,
variables: Optional[Sequence[GetPropertyRulesTemplateVariable]] = None,
opts: Optional[InvokeOptions] = None) -> GetPropertyRulesTemplateResult
def get_property_rules_template_output(template_file: Optional[pulumi.Input[str]] = None,
templates: Optional[pulumi.Input[Sequence[pulumi.Input[GetPropertyRulesTemplateTemplateArgs]]]] = None,
var_definition_file: Optional[pulumi.Input[str]] = None,
var_values_file: Optional[pulumi.Input[str]] = None,
variables: Optional[pulumi.Input[Sequence[pulumi.Input[GetPropertyRulesTemplateVariableArgs]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetPropertyRulesTemplateResult]
func GetPropertyRulesTemplate(ctx *Context, args *GetPropertyRulesTemplateArgs, opts ...InvokeOption) (*GetPropertyRulesTemplateResult, error)
func GetPropertyRulesTemplateOutput(ctx *Context, args *GetPropertyRulesTemplateOutputArgs, opts ...InvokeOption) GetPropertyRulesTemplateResultOutput
> Note: This function is named GetPropertyRulesTemplate
in the Go SDK.
public static class GetPropertyRulesTemplate
{
public static Task<GetPropertyRulesTemplateResult> InvokeAsync(GetPropertyRulesTemplateArgs args, InvokeOptions? opts = null)
public static Output<GetPropertyRulesTemplateResult> Invoke(GetPropertyRulesTemplateInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetPropertyRulesTemplateResult> getPropertyRulesTemplate(GetPropertyRulesTemplateArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: akamai:index/getPropertyRulesTemplate:getPropertyRulesTemplate
arguments:
# arguments dictionary
The following arguments are supported:
- Template
File string The absolute path to your top-level JSON template file. The top-level template combines smaller, nested JSON templates to form your property rule tree. This argument conflicts with the
template
argument.- Templates
List<Get
Property Rules Template Template> The template you use in your configuration. This argument conflicts with the
template_file
argument.- Var
Definition stringFile Required when using
var_values_file
. The absolute path to the file containing variable definitions and defaults. This argument conflicts with thevariables
argument.- Var
Values stringFile Required when using
var_definition_file
. The absolute path to the file containing variable values. This argument conflicts with thevariables
argument.- Variables
List<Get
Property Rules Template Variable> The definition of one or more variables. This argument conflicts with the
var_definition_file
andvar_values_file
arguments. Avariables
block includes:
- Template
File string The absolute path to your top-level JSON template file. The top-level template combines smaller, nested JSON templates to form your property rule tree. This argument conflicts with the
template
argument.- Templates
[]Get
Property Rules Template Template The template you use in your configuration. This argument conflicts with the
template_file
argument.- Var
Definition stringFile Required when using
var_values_file
. The absolute path to the file containing variable definitions and defaults. This argument conflicts with thevariables
argument.- Var
Values stringFile Required when using
var_definition_file
. The absolute path to the file containing variable values. This argument conflicts with thevariables
argument.- Variables
[]Get
Property Rules Template Variable The definition of one or more variables. This argument conflicts with the
var_definition_file
andvar_values_file
arguments. Avariables
block includes:
- template
File String The absolute path to your top-level JSON template file. The top-level template combines smaller, nested JSON templates to form your property rule tree. This argument conflicts with the
template
argument.- templates
List<Get
Property Rules Template Template> The template you use in your configuration. This argument conflicts with the
template_file
argument.- var
Definition StringFile Required when using
var_values_file
. The absolute path to the file containing variable definitions and defaults. This argument conflicts with thevariables
argument.- var
Values StringFile Required when using
var_definition_file
. The absolute path to the file containing variable values. This argument conflicts with thevariables
argument.- variables
List<Get
Property Rules Template Variable> The definition of one or more variables. This argument conflicts with the
var_definition_file
andvar_values_file
arguments. Avariables
block includes:
- template
File string The absolute path to your top-level JSON template file. The top-level template combines smaller, nested JSON templates to form your property rule tree. This argument conflicts with the
template
argument.- templates
Get
Property Rules Template Template[] The template you use in your configuration. This argument conflicts with the
template_file
argument.- var
Definition stringFile Required when using
var_values_file
. The absolute path to the file containing variable definitions and defaults. This argument conflicts with thevariables
argument.- var
Values stringFile Required when using
var_definition_file
. The absolute path to the file containing variable values. This argument conflicts with thevariables
argument.- variables
Get
Property Rules Template Variable[] The definition of one or more variables. This argument conflicts with the
var_definition_file
andvar_values_file
arguments. Avariables
block includes:
- template_
file str The absolute path to your top-level JSON template file. The top-level template combines smaller, nested JSON templates to form your property rule tree. This argument conflicts with the
template
argument.- templates
Sequence[Get
Property Rules Template Template] The template you use in your configuration. This argument conflicts with the
template_file
argument.- var_
definition_ strfile Required when using
var_values_file
. The absolute path to the file containing variable definitions and defaults. This argument conflicts with thevariables
argument.- var_
values_ strfile Required when using
var_definition_file
. The absolute path to the file containing variable values. This argument conflicts with thevariables
argument.- variables
Sequence[Get
Property Rules Template Variable] The definition of one or more variables. This argument conflicts with the
var_definition_file
andvar_values_file
arguments. Avariables
block includes:
- template
File String The absolute path to your top-level JSON template file. The top-level template combines smaller, nested JSON templates to form your property rule tree. This argument conflicts with the
template
argument.- templates List<Property Map>
The template you use in your configuration. This argument conflicts with the
template_file
argument.- var
Definition StringFile Required when using
var_values_file
. The absolute path to the file containing variable definitions and defaults. This argument conflicts with thevariables
argument.- var
Values StringFile Required when using
var_definition_file
. The absolute path to the file containing variable values. This argument conflicts with thevariables
argument.- variables List<Property Map>
The definition of one or more variables. This argument conflicts with the
var_definition_file
andvar_values_file
arguments. Avariables
block includes:
getPropertyRulesTemplate Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Json string
- Template
File string - Templates
List<Get
Property Rules Template Template> - Var
Definition stringFile - Var
Values stringFile - Variables
List<Get
Property Rules Template Variable>
- Id string
The provider-assigned unique ID for this managed resource.
- Json string
- Template
File string - Templates
[]Get
Property Rules Template Template - Var
Definition stringFile - Var
Values stringFile - Variables
[]Get
Property Rules Template Variable
- id String
The provider-assigned unique ID for this managed resource.
- json String
- template
File String - templates
List<Get
Property Rules Template Template> - var
Definition StringFile - var
Values StringFile - variables
List<Get
Property Rules Template Variable>
- id string
The provider-assigned unique ID for this managed resource.
- json string
- template
File string - templates
Get
Property Rules Template Template[] - var
Definition stringFile - var
Values stringFile - variables
Get
Property Rules Template Variable[]
- id str
The provider-assigned unique ID for this managed resource.
- json str
- template_
file str - templates
Sequence[Get
Property Rules Template Template] - var_
definition_ strfile - var_
values_ strfile - variables
Sequence[Get
Property Rules Template Variable]
- id String
The provider-assigned unique ID for this managed resource.
- json String
- template
File String - templates List<Property Map>
- var
Definition StringFile - var
Values StringFile - variables List<Property Map>
Supporting Types
GetPropertyRulesTemplateTemplate
- Template
Data string The content of the JSON template as a string.
- Template
Dir string The absolute or relative path to the directory containing the template files. The path must end with
property-snippets
, the required directory name. For example:template_dir = abspath("${path.root}/property-snippets/")
, ortemplate_dir = "property-snippets/"
.
- Template
Data string The content of the JSON template as a string.
- Template
Dir string The absolute or relative path to the directory containing the template files. The path must end with
property-snippets
, the required directory name. For example:template_dir = abspath("${path.root}/property-snippets/")
, ortemplate_dir = "property-snippets/"
.
- template
Data String The content of the JSON template as a string.
- template
Dir String The absolute or relative path to the directory containing the template files. The path must end with
property-snippets
, the required directory name. For example:template_dir = abspath("${path.root}/property-snippets/")
, ortemplate_dir = "property-snippets/"
.
- template
Data string The content of the JSON template as a string.
- template
Dir string The absolute or relative path to the directory containing the template files. The path must end with
property-snippets
, the required directory name. For example:template_dir = abspath("${path.root}/property-snippets/")
, ortemplate_dir = "property-snippets/"
.
- template_
data str The content of the JSON template as a string.
- template_
dir str The absolute or relative path to the directory containing the template files. The path must end with
property-snippets
, the required directory name. For example:template_dir = abspath("${path.root}/property-snippets/")
, ortemplate_dir = "property-snippets/"
.
- template
Data String The content of the JSON template as a string.
- template
Dir String The absolute or relative path to the directory containing the template files. The path must end with
property-snippets
, the required directory name. For example:template_dir = abspath("${path.root}/property-snippets/")
, ortemplate_dir = "property-snippets/"
.
GetPropertyRulesTemplateVariable
Package Details
- Repository
- Akamai pulumi/pulumi-akamai
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
akamai
Terraform Provider.