Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clickhouse S3 Form: Add Role ARN field #2024

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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 nexus/analyzer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,7 @@ fn parse_db_options(db_type: DbType, with_options: &[SqlOption]) -> anyhow::Resu
.map(|s| s.parse::<bool>().unwrap_or_default())
.unwrap_or_default(),
endpoint: opts.get("endpoint").map(|s| s.to_string()),
role_arn: opts.get("role_arn").map(|s| s.to_string()),
certificate: opts.get("certificate").map(|s| s.to_string()),
private_key: opts.get("private_key").map(|s| s.to_string()),
};
Expand Down
1 change: 1 addition & 0 deletions protos/peers.proto
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ message ClickhouseConfig{
optional string endpoint = 11;
optional string certificate = 12 [(peerdb_redacted) = true];
optional string private_key = 13 [(peerdb_redacted) = true];
optional string role_arn = 14;
}

message SqlServerConfig {
Expand Down
10 changes: 10 additions & 0 deletions ui/app/peers/create/[peerType]/helpers/ch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ export const clickhouseSetting: PeerSetting[] = [
tips: 'An endpoint is the URL of the entry point for an AWS web service.',
optional: true,
},
{
label: 'Role ARN',
stateHandler: (value, setter) =>
setter((curr) => ({ ...curr, roleArn: value as string })),
tips: 'If set, the role ARN will be used to assume the role before accessing the bucket.',
helpfulLink:
'https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns',
optional: true,
},
{
label: 'Certificate',
stateHandler: (value, setter) => {
Expand Down Expand Up @@ -126,4 +135,5 @@ export const blankClickhouseSetting: ClickhouseConfig = {
region: '',
disableTls: false,
endpoint: undefined,
roleArn: undefined,
};
3 changes: 3 additions & 0 deletions ui/app/peers/create/[peerType]/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ export const chSchema = (hostDomains: string[]) =>
endpoint: z
.string({ invalid_type_error: 'Endpoint must be a string' })
.optional(),
roleArn: z
.string({ invalid_type_error: 'Role ARN must be a string' })
.optional(),
disableTls: z.boolean(),
certificate: z
.string({
Expand Down
1 change: 1 addition & 0 deletions ui/components/PeerForms/ClickhouseConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default function ClickhouseForm({ settings, setter }: ConfigProps) {
'Secret Access Key',
'Region',
'Endpoint',
'Role ARN',
];

const handleFile = (
Expand Down
Loading