interfaces

package
v2.226.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

README

CDK Resource Interfaces

This module contains resource interfaces for all AWS service resources.

These are interfaces that look like this:

/**
 * Indicates that this resource can be referenced as a Bucket.
 */
interface IBucketRef {
  /**
   * A reference to a Bucket resource.
   */
  readonly bucketRef: BucketReference;
}

interface BucketReference {
  /**
   * The BucketName of the Bucket resource.
   */
  readonly bucketName: string;

  /**
   * The ARN of the Bucket resource.
   */
  readonly bucketArn: string;
}

These are in a separate submodule so that they can be referenced from all other service submodules without introducing cyclic dependencies between them.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IEnvironmentAware

type IEnvironmentAware interface {
	// The environment this resource belongs to.
	//
	// For resources that are created and managed in a Stack (those created by
	// creating new class instances like `new Role()`, `new Bucket()`, etc.), this
	// is always the same as the environment of the stack they belong to.
	//
	// For referenced resources (those obtained from referencing methods like
	// `Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
	// different than the stack they were imported into.
	Env() *ResourceEnvironment
}

Used to indicate that a particular construct has an resource environment.

type ResourceEnvironment

type ResourceEnvironment struct {
	// The AWS Account ID that this resource belongs to.
	//
	// Since this can be a Token (for example, when the account is
	// CloudFormation's `AWS::AccountId` intrinsic), make sure to use
	// `Token.compareStrings()` instead of comparing the values with direct
	// string equality.
	Account *string `field:"required" json:"account" yaml:"account"`
	// The AWS Region that this resource belongs to.
	//
	// Since this can be a Token (for example, when the region is CloudFormation's
	// `AWS::Region` intrinsic), make sure to use `Token.compareStrings()` instead
	// of comparing the values with direct string equality.
	Region *string `field:"required" json:"region" yaml:"region"`
}

Represents the environment a given resource lives in.

Used as the return value for the `IEnvironmentAware.env` property.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

resourceEnvironment := &ResourceEnvironment{
	Account: jsii.String("account"),
	Region: jsii.String("region"),
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL