Skip to content

Commit

Permalink
feat: redshift iam support
Browse files Browse the repository at this point in the history
  • Loading branch information
achettyiitr committed Jul 24, 2024
1 parent e9ea507 commit cc0de76
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 9 deletions.
4 changes: 4 additions & 0 deletions src/configurations/destinations/rs/db-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@
"port",
"database",
"user",
"useIAMForAuth",
"password",
"iamRoleARNForAuth",
"clusterId",
"clusterRegion",
"bucketName",
"iamRoleARN",
"roleBasedAuth",
Expand Down
63 changes: 54 additions & 9 deletions src/configurations/destinations/rs/schema.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
{
"configSchema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [
"host",
"port",
"database",
"user",
"password",
"syncFrequency",
"useRudderStorage"
],
"required": ["host", "port", "database", "user", "syncFrequency", "useRudderStorage"],
"type": "object",
"properties": {
"host": {
Expand Down Expand Up @@ -54,6 +46,7 @@
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.*)$"
},
"useRudderStorage": { "type": "boolean", "default": false },
"useIAMForAuth": { "type": "boolean", "default": false },
"preferAppend": { "type": "boolean", "default": true },
"oneTrustCookieCategories": {
"type": "array",
Expand Down Expand Up @@ -596,6 +589,58 @@
}
},
"allOf": [
{
"if": {
"properties": {
"useIAMForAuth": {
"const": false
}
},
"required": ["useIAMForAuth"]
},
"then": {
"properties": {
"password": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|.*"
},
"useIAMForAuth": {
"const": false
}
},
"required": ["password"]
}
},
{
"if": {
"properties": {
"useIAMForAuth": {
"const": true
}
},
"required": ["useIAMForAuth"]
},
"then": {
"properties": {
"iamRoleARNForAuth": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$"
},
"clusterId": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,255})$"
},
"clusterRegion": {
"type": "string",
"pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,255})$"
},
"useIAMForAuth": {
"const": true
}
},
"required": ["iamRoleARNForAuth", "clusterId", "clusterRegion", "useIAMForAuth"]
}
},
{
"if": {
"properties": { "useRudderStorage": { "const": false } },
Expand Down
58 changes: 58 additions & 0 deletions src/configurations/destinations/rs/ui-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,73 @@
"placeholder": "e.g: warehouseuser",
"required": true
},
{
"type": "checkbox",
"label": "Use IAM for Authentication",
"value": "useIAMForAuth",
"required": false,
"default": false
},
{
"type": "textInput",
"preRequisiteField": [
{
"name": "useIAMForAuth",
"selectedValue": false
}
],
"label": "Password",
"value": "password",
"regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|.*",
"placeholder": "e.g: warehousepassword",
"required": true,
"secret": true
},
{
"type": "textInput",
"preRequisiteField": [
{
"name": "useIAMForAuth",
"selectedValue": true
}
],
"label": "IAM Role ARN For Authentication",
"value": "iamRoleARNForAuth",
"regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$",
"regexErrorMessage": "Invalid Role ARN",
"required": true,
"placeholder": "e.g: arn:aws:iam::12345X789012:role/RedshiftAccess"
},
{
"type": "textInput",
"preRequisiteField": [
{
"name": "useIAMForAuth",
"selectedValue": true
}
],
"label": "Cluster Id",
"value": "clusterId",
"regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,255})$",
"regexErrorMessage": "Invalid ClusterID",
"placeholder": "Cluster Identifier",
"required": true
},
{
"type": "textInput",
"preRequisiteField": [
{
"name": "useIAMForAuth",
"selectedValue": true
}
],
"label": "Cluster region",
"value": "clusterRegion",
"regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,255})$",
"regexErrorMessage": "Invalid Cluster region",
"placeholder": "Cluster Identifier",
"required": true
},
{
"type": "textInput",
"label": "Namespace",
Expand Down

0 comments on commit cc0de76

Please sign in to comment.