AgentcorePolicyEngine class

Manages an AWS Bedrock AgentCore Policy Engine. A Policy Engine controls what actions and resources an agent runtime can use.

Example Usage

Basic Usage

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

const example = new aws.bedrock.AgentcorePolicyEngine("example", {name: "example_policy_engine"});
import pulumi
import pulumi_aws as aws

example = aws.bedrock.AgentcorePolicyEngine("example", name="example_policy_engine")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.Bedrock.AgentcorePolicyEngine("example", new()
    {
        Name = "example_policy_engine",
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/bedrock"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := bedrock.NewAgentcorePolicyEngine(ctx, "example", &bedrock.AgentcorePolicyEngineArgs{
			Name: pulumi.String("example_policy_engine"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_bedrock_agentcorepolicyengine" "example" {
  name = "example_policy_engine"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.bedrock.AgentcorePolicyEngine;
import com.pulumi.aws.bedrock.AgentcorePolicyEngineArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 example = new AgentcorePolicyEngine("example", AgentcorePolicyEngineArgs.builder()
            .name("example_policy_engine")
            .build());

    }
}
resources:
  example:
    type: aws:bedrock:AgentcorePolicyEngine
    properties:
      name: example_policy_engine

With Description

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

const example = new aws.bedrock.AgentcorePolicyEngine("example", {
    name: "example_policy_engine",
    description: "Policy engine for customer service agent",
});
import pulumi
import pulumi_aws as aws

example = aws.bedrock.AgentcorePolicyEngine("example",
    name="example_policy_engine",
    description="Policy engine for customer service agent")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.Bedrock.AgentcorePolicyEngine("example", new()
    {
        Name = "example_policy_engine",
        Description = "Policy engine for customer service agent",
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/bedrock"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := bedrock.NewAgentcorePolicyEngine(ctx, "example", &bedrock.AgentcorePolicyEngineArgs{
			Name:        pulumi.String("example_policy_engine"),
			Description: pulumi.String("Policy engine for customer service agent"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_bedrock_agentcorepolicyengine" "example" {
  name        = "example_policy_engine"
  description = "Policy engine for customer service agent"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.bedrock.AgentcorePolicyEngine;
import com.pulumi.aws.bedrock.AgentcorePolicyEngineArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 example = new AgentcorePolicyEngine("example", AgentcorePolicyEngineArgs.builder()
            .name("example_policy_engine")
            .description("Policy engine for customer service agent")
            .build());

    }
}
resources:
  example:
    type: aws:bedrock:AgentcorePolicyEngine
    properties:
      name: example_policy_engine
      description: Policy engine for customer service agent

With Custom Encryption

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

const example = new aws.kms.Key("example", {
    description: "KMS key for Bedrock AgentCore Policy Engine",
    deletionWindowInDays: 7,
});
const exampleAgentcorePolicyEngine = new aws.bedrock.AgentcorePolicyEngine("example", {
    name: "example_policy_engine",
    description: "Policy engine for customer service agent",
    encryptionKeyArn: example.arn,
});
import pulumi
import pulumi_aws as aws

example = aws.kms.Key("example",
    description="KMS key for Bedrock AgentCore Policy Engine",
    deletion_window_in_days=7)
example_agentcore_policy_engine = aws.bedrock.AgentcorePolicyEngine("example",
    name="example_policy_engine",
    description="Policy engine for customer service agent",
    encryption_key_arn=example.arn)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var example = new Aws.Kms.Key("example", new()
    {
        Description = "KMS key for Bedrock AgentCore Policy Engine",
        DeletionWindowInDays = 7,
    });

    var exampleAgentcorePolicyEngine = new Aws.Bedrock.AgentcorePolicyEngine("example", new()
    {
        Name = "example_policy_engine",
        Description = "Policy engine for customer service agent",
        EncryptionKeyArn = example.Arn,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/bedrock"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/kms"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := kms.NewKey(ctx, "example", &kms.KeyArgs{
			Description:          pulumi.String("KMS key for Bedrock AgentCore Policy Engine"),
			DeletionWindowInDays: pulumi.Int(7),
		})
		if err != nil {
			return err
		}
		_, err = bedrock.NewAgentcorePolicyEngine(ctx, "example", &bedrock.AgentcorePolicyEngineArgs{
			Name:             pulumi.String("example_policy_engine"),
			Description:      pulumi.String("Policy engine for customer service agent"),
			EncryptionKeyArn: example.Arn,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_kms_key" "example" {
  description             = "KMS key for Bedrock AgentCore Policy Engine"
  deletion_window_in_days = 7
}
resource "aws_bedrock_agentcorepolicyengine" "example" {
  name               = "example_policy_engine"
  description        = "Policy engine for customer service agent"
  encryption_key_arn = aws_kms_key.example.arn
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.kms.Key;
import com.pulumi.aws.kms.KeyArgs;
import com.pulumi.aws.bedrock.AgentcorePolicyEngine;
import com.pulumi.aws.bedrock.AgentcorePolicyEngineArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 example = new Key("example", KeyArgs.builder()
            .description("KMS key for Bedrock AgentCore Policy Engine")
            .deletionWindowInDays(7)
            .build());

        var exampleAgentcorePolicyEngine = new AgentcorePolicyEngine("exampleAgentcorePolicyEngine", AgentcorePolicyEngineArgs.builder()
            .name("example_policy_engine")
            .description("Policy engine for customer service agent")
            .encryptionKeyArn(example.arn())
            .build());

    }
}
resources:
  example:
    type: aws:kms:Key
    properties:
      description: KMS key for Bedrock AgentCore Policy Engine
      deletionWindowInDays: 7
  exampleAgentcorePolicyEngine:
    type: aws:bedrock:AgentcorePolicyEngine
    name: example
    properties:
      name: example_policy_engine
      description: Policy engine for customer service agent
      encryptionKeyArn: ${example.arn}

Import

Identity Schema

Required

  • policyEngineId (String) Policy engine ID.

Optional

  • accountId (String) AWS account ID for this resource.
  • region (String) AWS Region for this resource.

Using pulumi import, import a Bedrock AgentCore Policy Engine by policy engine ID. For example:

$ pulumi import aws:bedrock/agentcorePolicyEngine:AgentcorePolicyEngine example policy-engine-id-12345678

Constructors

AgentcorePolicyEngine(String name, {AgentcorePolicyEngineArgs? args, CustomResourceOptions? options})
Creates a new AgentcorePolicyEngine. name The Pulumi resource name. args Arguments used to configure this AgentcorePolicyEngine. The set of arguments for AgentcorePolicyEngine. options Resource options controlling this resource's behavior.
AgentcorePolicyEngine.reference(String urn)
Creates a typed reference to an existing AgentcorePolicyEngine resource.

Properties

childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
description ↔ Output<String?>
Description of the policy engine.
latefinal
encryptionKeyArn ↔ Output<String?>
ARN of the KMS key used to encrypt the policy engine. If not set, AWS uses an AWS managed key.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
name ↔ Output<String>
Name of the policy engine. Must start with a letter and contain only letters, numbers, and underscores. Maximum length of 48 characters.
latefinal
policyEngineArn ↔ Output<String>
ARN of the Policy Engine.
latefinal
policyEngineId ↔ Output<String>
Unique identifier of the Policy Engine.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tags ↔ Output<Map<String, String>?>
Key-value map of resource tags. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
latefinal
tagsAll ↔ Output<Map<String, String>>
Map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
latefinal
timeouts ↔ Output<AgentcorePolicyEngineTimeouts?>
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {AgentcorePolicyEngineState? state, CustomResourceOptions? options}) → AgentcorePolicyEngine
Gets an existing AgentcorePolicyEngine resource's state with the given name and id.