-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
129d819
commit 2d21b3c
Showing
20 changed files
with
558 additions
and
3,388 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as aws from '@pulumi/aws' | ||
import { ModelCaseWrapper } from '../../wrappers' | ||
|
||
interface Args { | ||
Name: string | ||
UserNames: string[] | ||
Tags: ModelCaseWrapper<Record<string, string>> | ||
} | ||
|
||
// noinspection JSUnusedLocalSymbols | ||
function create(args: Args): aws.memorydb.Acl { | ||
return new aws.memorydb.Acl(args.Name, { | ||
//TMPL {{- if .UserNames }} | ||
userNames: args.UserNames, | ||
//TMPL {{- end }} | ||
//TMPL {{- if .Tags }} | ||
tags: args.Tags, | ||
//TMPL {{- end }} | ||
}) | ||
} | ||
|
||
function properties(object: aws.memorydb.Acl, args: Args) { | ||
return { | ||
Arn: object.arn, | ||
Id: object.id, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "memorydb_acl", | ||
"dependencies": { | ||
"@pulumi/aws": "^5.37.0" | ||
} | ||
} |
103 changes: 103 additions & 0 deletions
103
pkg/infra/iac/templates/aws/memorydb_cluster/factory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
import * as aws from '@pulumi/aws' | ||
import { ModelCaseWrapper } from '../../wrappers' | ||
import * as pulumi from '@pulumi/pulumi' | ||
|
||
interface Args { | ||
Name: string | ||
Acl: string | ||
NodeType: string | ||
AutoMinorVersionUpgrade: boolean | ||
DataTiering: string | ||
Description: string | ||
EngineVersion: string | ||
FinalSnapshotName: string | ||
MaintenanceWindow: string | ||
NumReplicasPerShard: number | ||
NumShards: number | ||
ParameterGroupName: string | ||
Port: number | ||
SecurityGroups: aws.ec2.SecurityGroup[] | ||
SnapshotArns: string[] | ||
SnapshotName: string | ||
SnapshotRetentionLimit: number | ||
SnapshotWindow: string | ||
SubnetGroup: aws.memorydb.SubnetGroup | ||
Tags: ModelCaseWrapper<Record<string, string>> | ||
TlsEnabled: boolean | ||
} | ||
|
||
// noinspection JSUnusedLocalSymbols | ||
function create(args: Args): aws.memorydb.Cluster { | ||
return new aws.memorydb.Cluster(args.Name, { | ||
aclName: args.Acl, | ||
nodeType: args.NodeType, | ||
//TMPL {{- if .AutoMinorVersionUpgrade }} | ||
autoMinorVersionUpgrade: args.AutoMinorVersionUpgrade, | ||
//TMPL {{- end }} | ||
//TMPL {{- if .DataTiering }} | ||
dataTiering: args.DataTiering, | ||
//TMPL {{- end }} | ||
//TMPL {{- if .Description }} | ||
description: args.Description, | ||
//TMPL {{- end }} | ||
//TMPL {{- if .EngineVersion }} | ||
engineVersion: args.EngineVersion, | ||
//TMPL {{- end }} | ||
//TMPL {{- if .FinalSnapshotName }} | ||
finalSnapshotName: args.FinalSnapshotName, | ||
//TMPL {{- end }} | ||
//TMPL {{- if .MaintenanceWindow }} | ||
maintenanceWindow: args.MaintenanceWindow, | ||
//TMPL {{- end }} | ||
//TMPL {{- if .NumReplicasPerShard }} | ||
numReplicasPerShard: args.NumReplicasPerShard, | ||
//TMPL {{- end }} | ||
//TMPL {{- if .NumShards }} | ||
numShards: args.NumShards, | ||
//TMPL {{- end }} | ||
//TMPL {{- if .ParameterGroupName }} | ||
parameterGroupName: args.ParameterGroupName, | ||
//TMPL {{- end }} | ||
//TMPL {{- if .Port }} | ||
port: args.Port, | ||
//TMPL {{- end }} | ||
//TMPL {{- if .SecurityGroups }} | ||
securityGroupIds: args.SecurityGroups.map((sg) => sg.id), | ||
//TMPL {{- end }} | ||
//TMPL {{- if .SnapshotArns }} | ||
snapshotArns: args.SnapshotArns, | ||
//TMPL {{- end }} | ||
//TMPL {{- if .SnapshotName }} | ||
snapshotName: args.SnapshotName, | ||
//TMPL {{- end }} | ||
//TMPL {{- if .SnapshotRetentionLimit }} | ||
snapshotRetentionLimit: args.SnapshotRetentionLimit, | ||
//TMPL {{- end }} | ||
//TMPL {{- if .SnapshotWindow }} | ||
snapshotWindow: args.SnapshotWindow, | ||
//TMPL {{- end }} | ||
//TMPL {{- if .SubnetGroup }} | ||
subnetGroupName: args.SubnetGroup.name, | ||
//TMPL {{- end }} | ||
//TMPL {{- if .Tags }} | ||
tags: args.Tags, | ||
//TMPL {{- end }} | ||
//TMPL {{- if .TlsEnabled }} | ||
tlsEnabled: args.TlsEnabled, | ||
//TMPL {{- end }} | ||
}) | ||
} | ||
|
||
function properties(object: aws.memorydb.Cluster, args: Args) { | ||
return { | ||
Arn: object.arn, | ||
ClusterEndpoints: object.clusterEndpoints, | ||
ClusterEndpointString: pulumi.interpolate`${object.clusterEndpoints.apply((endpoints) => { | ||
const endpointStrings: string[] = [] | ||
for (const endpoint of endpoints) { | ||
endpointStrings.push(`${endpoint.address}:${endpoint.port}`) | ||
} | ||
return endpointStrings.join(',') | ||
})}`, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "memorydb_cluster", | ||
"dependencies": { | ||
"@pulumi/aws": "^5.37.0", | ||
"@pulumi/pulumi": "^3.69.0" | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
pkg/infra/iac/templates/aws/memorydb_subnetgroup/factory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import * as aws from '@pulumi/aws' | ||
import * as awsInputs from '@pulumi/aws/types/input' | ||
import { ModelCaseWrapper } from '../../wrappers' | ||
|
||
interface Args { | ||
Name: string | ||
Subnets: aws.ec2.Subnet[] | ||
Description: string | ||
Tags: ModelCaseWrapper<Record<string, string>> | ||
} | ||
|
||
// noinspection JSUnusedLocalSymbols | ||
function create(args: Args): aws.memorydb.SubnetGroup { | ||
return new aws.memorydb.SubnetGroup(args.Name, { | ||
subnetIds: args.Subnets.map((subnet) => subnet.id), | ||
//TMPL {{- if .Description }} | ||
description: args.Description, | ||
//TMPL {{- end }} | ||
//TMPL {{- if .Tags }} | ||
tags: args.Tags, | ||
//TMPL {{- end }} | ||
}) | ||
} | ||
|
||
function properties(object: aws.memorydb.SubnetGroup, args: Args) { | ||
return { | ||
Arn: object.arn, | ||
Id: object.id, | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
pkg/infra/iac/templates/aws/memorydb_subnetgroup/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "memorydb_subnetgroup", | ||
"dependencies": { | ||
"@pulumi/aws": "^5.37.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import * as aws from '@pulumi/aws' | ||
import * as awsInputs from '@pulumi/aws/types/input' | ||
import { ModelCaseWrapper } from '../../wrappers' | ||
import * as pulumi from '@pulumi/pulumi' | ||
|
||
interface Args { | ||
Name: string | ||
AccessString: string | ||
AuthenticationMode: awsInputs.memorydb.UserAuthenticationMode | ||
Tags: ModelCaseWrapper<Record<string, string>> | ||
} | ||
|
||
// noinspection JSUnusedLocalSymbols | ||
function create(args: Args): aws.memorydb.User { | ||
return new aws.memorydb.User(args.Name, { | ||
accessString: args.AccessString, | ||
authenticationMode: { | ||
type: 'password', | ||
passwords: [kloConfig.requireSecret(`${args.Name}-password`)], | ||
}, | ||
userName: args.Name, | ||
//TMPL {{- if .Tags }} | ||
tags: args.Tags, | ||
//TMPL {{- end }} | ||
}) | ||
} | ||
|
||
function properties(object: aws.memorydb.User, args: Args) { | ||
return { | ||
Arn: object.arn, | ||
Id: object.id, | ||
Username: object.userName, | ||
Password: kloConfig.requireSecret(`${args.Name}-password`), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "memorydb_user", | ||
"dependencies": { | ||
"@pulumi/aws": "^5.37.0", | ||
"@pulumi/pulumi": "^3.69.0" | ||
} | ||
} |
Oops, something went wrong.