Class Resource
Represents a template resource
Inherited Members
Namespace: Firefly.CloudFormationParser.TemplateObjects
Assembly: Firefly.CloudFormationParser.dll
Syntax
public class Resource : IConditionalTemplateObject, IResource, ITemplateObject
Properties
| Improve this Doc View SourceCondition
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 |
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. |
DeletionPolicy
Gets or sets the deletion policy.
Declaration
[YamlMember(Order = 5)]
public string DeletionPolicy { get; set; }
Property Value
Type | Description |
---|---|
String | The deletion policy. |
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 |
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 |
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. |
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. |
IsSAMResource
Gets a value indicating whether this resource is a SAM declaration..
Declaration
[YamlIgnore]
public bool IsSAMResource { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
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. |
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. |
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. |
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. |
Transform
Gets or sets the transform.
Declaration
[YamlMember(Order = 12)]
public object Transform { get; set; }
Property Value
Type | Description |
---|---|
Object | The transform. |
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. |
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. |
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. |
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 SourceGetResourcePropertyValue(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 |
ToString()
Converts to string.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A String that represents this instance. |
Overrides
| Improve this Doc View SourceUpdateResourceProperty(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 |
Object | newValue | The new value. |
Exceptions
Type | Condition |
---|---|
FormatException | Resource format is unknown (not JSON or YAML) |