Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ kurgan add redshift
| Encrypt | If true, the data in the cluster is encrypted at rest | | false | String | ['true', 'false']
| KmsKeyId | The AWS Key Management Service (KMS) key ID of the encryption key that you want to use to encrypt data in the cluster. | | | |
| Snapshot | The name of the snapshot from which to create the new cluster | | false | String |
| SnapshotOwnerAccount |The AWS account used to create or copy the snapshot | | false | String |
| DatabaseName | The name of the first database to be created when the cluster is created. | | false | String |

## Configuration
Expand Down
1 change: 1 addition & 0 deletions redshift.cfhighlander.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
ComponentParam 'Encrypt', 'true', allowedValues: ['true', 'false']
ComponentParam 'KmsKeyId', ''
ComponentParam 'Snapshot', ''
ComponentParam 'SnapshotOwnerAccount', ''
ComponentParam 'DatabaseName', ''
end

Expand Down
2 changes: 2 additions & 0 deletions redshift.cfndsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
Condition(:RedshiftSingleNodeClusterCondition, FnEquals(Ref(:NumberOfNodes), '1'))
Condition(:EnableLoggingCondition, FnEquals(Ref(:EnableLogging), 'true'))
Condition(:SnapshotSet, FnNot(FnEquals(Ref(:Snapshot), '')))
Condition(:OwnerAccountSet, FnNot(FnEquals(Ref(:SnapshotOwnerAccount), '')))
Condition(:DatabaseNameSet, FnNot(FnEquals(Ref(:DatabaseName), '')))
Condition(:EncryptWithKMS, FnAnd([
FnNot(FnEquals(Ref(:KmsKeyId), '')),
Expand Down Expand Up @@ -146,6 +147,7 @@
)
IamRoles [FnGetAtt(:RedshiftIAMRole, :Arn)]
SnapshotIdentifier FnIf(:SnapshotSet, Ref(:Snapshot), Ref('AWS::NoValue'))
OwnerAccount FnIf(:OwnerAccountSet, Ref(:SnapshotOwnerAccount), Ref('AWS::NoValue'))
Tags redshift_tags
}

Expand Down
4 changes: 4 additions & 0 deletions spec/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@
expect(resource["Properties"]["SnapshotIdentifier"]).to eq({"Fn::If"=>["SnapshotSet", {"Ref"=>"Snapshot"}, {"Ref"=>"AWS::NoValue"}]})
end

it "to have property OwnerAccount" do
expect(resource["Properties"]["OwnerAccount"]).to eq({"Fn::If"=>["OwnerAccountSet", {"Ref"=>"SnapshotOwnerAccount"}, {"Ref"=>"AWS::NoValue"}]})
end

it "to have property Tags" do
expect(resource["Properties"]["Tags"]).to eq([{"Key"=>"Environment", "Value"=>{"Ref"=>"EnvironmentName"}}])
end
Expand Down
4 changes: 4 additions & 0 deletions spec/tags_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@
it "to have property SnapshotIdentifier" do
expect(resource["Properties"]["SnapshotIdentifier"]).to eq({"Fn::If"=>["SnapshotSet", {"Ref"=>"Snapshot"}, {"Ref"=>"AWS::NoValue"}]})
end

it "to have property OwnerAccount" do
expect(resource["Properties"]["OwnerAccount"]).to eq({"Fn::If"=>["OwnerAccountSet", {"Ref"=>"SnapshotOwnerAccount"}, {"Ref"=>"AWS::NoValue"}]})
end

it "to have property Tags" do
expect(resource["Properties"]["Tags"]).to eq([{"Key"=>"Environment", "Value"=>{"Ref"=>"EnvironmentName"}}, {"Key"=>"Locale", "Value"=>"AU"}])
Expand Down