Show / Hide Table of Contents

Class Resource

Represents a template resource

Inheritance
Object
Resource
Implements
IConditionalTemplateObject
IResource
ITemplateObject
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Namespace: Firefly.CloudFormationParser.TemplateObjects
Assembly: Firefly.CloudFormationParser.dll
Syntax
public class Resource : IConditionalTemplateObject, IResource, ITemplateObject

Properties

| Improve this Doc View Source

Condition

Gets or sets the resource's condition.

When present, associates this output with a condition defined in the Conditions section of the template.

Declaration
[YamlMember(Order = 0)]
public string Condition { get; set; }
Property Value
Type Description
String

The CloudFormation condition which will be null if the template did not provide this property.

| Improve this Doc View Source

CreationPolicy

Gets or sets the creation policy.

Declaration
[YamlMember(Order = 4)]
public Dictionary<string, object> CreationPolicy { get; set; }
Property Value
Type Description
Dictionary<String, Object>

The creation policy.

| Improve this Doc View Source

DeletionPolicy

Gets or sets the deletion policy.

Declaration
[YamlMember(Order = 5)]
public string DeletionPolicy { get; set; }
Property Value
Type Description
String

The deletion policy.

| Improve this Doc View Source

DependsOn

Gets or sets explicit dependencies on other resources in the template.

You should use the convenience property ExplicitDependencies to get the list of dependencies.

Declaration
[YamlMember(Order = 1)]
public object DependsOn { get; set; }
Property Value
Type Description
Object

The dependencies which will be null if the template did not provide this property.

| Improve this Doc View Source

Description

Gets or sets the resource's description.

A string type that describes the output value. The value for the description declaration must be a literal string that's between 0 and 1024 bytes in length.

Declaration
[YamlMember(Order = 3)]
public object Description { get; set; }
Property Value
Type Description
Object

The resource's description which will be null if the template did not provide this property.

| Improve this Doc View Source

ExplicitDependencies

Gets the explicit dependencies on other resources in the template.

Declaration
[YamlIgnore]
public IEnumerable<string> ExplicitDependencies { get; }
Property Value
Type Description
IEnumerable<String>

A list of explicit dependencies.

| Improve this Doc View Source

FnTransform

Gets or sets the function transform.

Declaration
[YamlMember(Order = 11, Alias = "Fn::Transform", DefaultValuesHandling = DefaultValuesHandling.OmitNull)]
public object FnTransform { get; set; }
Property Value
Type Description
Object

The function transform.

| Improve this Doc View Source

IsSAMResource

Gets a value indicating whether this resource is a SAM declaration..

Declaration
[YamlIgnore]
public bool IsSAMResource { get; }
Property Value
Type Description
Boolean

true if this instance is sam resource; otherwise, false.

| Improve this Doc View Source

Metadata

Gets or sets the metadata.

You can use the optional Metadata section to include arbitrary JSON or YAML objects that provide details about the resource. Often used with instances or launch templates to provide data for cfn-init.

Declaration
[YamlMember(Order = 9)]
public Dictionary<string, object> Metadata { get; set; }
Property Value
Type Description
Dictionary<String, Object>

The metadata.

| Improve this Doc View Source

Name

Gets or sets the name of the object

Names are set on these objects for convenience by the post-processing stage, as they are not part of the object definition as per CloudFormation. They are set as follows:

  • Parameter - The parameter name
  • Resource - The logical ID
  • Output - The output name

Declaration
[YamlIgnore]
public string Name { get; set; }
Property Value
Type Description
String

The name.

| Improve this Doc View Source

Properties

Gets or sets the resource properties.

Resource properties are additional options that you can specify for a resource. For example, for each EC2 instance, you must specify an Amazon Machine Image (AMI) ID for that instance.

Declaration
[YamlMember(Order = 10)]
public Dictionary<string, object> Properties { get; set; }
Property Value
Type Description
Dictionary<String, Object>

The properties.

| Improve this Doc View Source

Template

Gets or sets the template which this object is contained in.

Declaration
[YamlIgnore]
public ITemplate Template { get; set; }
Property Value
Type Description
ITemplate

The template.

| Improve this Doc View Source

Transform

Gets or sets the transform.

Declaration
[YamlMember(Order = 12)]
public object Transform { get; set; }
Property Value
Type Description
Object

The transform.

| Improve this Doc View Source

Type

Gets or sets the resource type.

The resource type identifies the type of resource that you are declaring. For example, AWS::EC2::Instance declares an EC2 instance.

Declaration
[YamlMember(Order = 2)]
public string Type { get; set; }
Property Value
Type Description
String

The type.

| Improve this Doc View Source

UpdatePolicy

Gets or sets the update policy.

Declaration
[YamlMember(Order = 6)]
public Dictionary<string, object> UpdatePolicy { get; set; }
Property Value
Type Description
Dictionary<String, Object>

The update policy.

| Improve this Doc View Source

UpdateReplacePolicy

Gets or sets the update replace policy.

Declaration
[YamlMember(Order = 7)]
public string UpdateReplacePolicy { get; set; }
Property Value
Type Description
String

The update replace policy.

| Improve this Doc View Source

Version

Gets or sets the resource version.

Declaration
[YamlMember(Order = 8)]
public string Version { get; set; }
Property Value
Type Description
String

The version.

Remarks

This property is valid for custom resources.

Methods

| Improve this Doc View Source

GetResourcePropertyValue(String)

Gets a resource property value. See Property Manipulation in the documentation.

Declaration
public object GetResourcePropertyValue(string propertyPath)
Parameters
Type Name Description
String propertyPath

The property path.

Returns
Type Description
Object

The value of the property; else null if the property path was not found.

| Improve this Doc View Source

ToString()

Converts to string.

Declaration
public override string ToString()
Returns
Type Description
String

A String that represents this instance.

Overrides
Object.ToString()
| Improve this Doc View Source

UpdateResourceProperty(String, Object)

Updates a property of this resource. See Property Manipulation in the documentation.

You would want to do this if you were implementing the functionality of aws cloudformation package to rewrite local file paths to S3 object locations.

Declaration
public void UpdateResourceProperty(string propertyPath, object newValue)
Parameters
Type Name Description
String propertyPath

Path to the property you want to set within this resource's Properties section, e.g. for a AWS::Glue::Job the path would be Command.ScriptLocation.

Object newValue

The new value.

Exceptions
Type Condition
FormatException

Resource format is unknown (not JSON or YAML)

Implements

IConditionalTemplateObject
IResource
ITemplateObject

Extension Methods

ResourceAcceptExtensions.Accept<TVisitor>(IResource, TVisitor)
ResourceAcceptExtensions.Accept<TContext>(IResource, ITemplateObjectVisitor<TContext>, TContext)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX