INFRA-3279 | fix to reudce too many changes visible in pr
This commit is contained in:
@@ -53,33 +53,35 @@ const AWSAccessForm = () => {
|
||||
isDeployed = values.extraResources.awsAccess.isDeployed;
|
||||
}
|
||||
return (
|
||||
<NotConfigured
|
||||
name="AWS Access"
|
||||
addRemoveCondition={_m.hasAwsAccess(values)}
|
||||
addAction={() => setValues(_m.addAwsAccess(values))}
|
||||
removeAction={() => setValues(_m.removeAwsAccess(values), true)}
|
||||
markDisabled={values.environment === Environment.LOCAL}
|
||||
isDeployed={isDeployed}
|
||||
>
|
||||
<Grid container direction="column" className={classes.root}>
|
||||
<FormikCardList
|
||||
name="extraResources.aws_access.policies"
|
||||
newItem={_m.newAwsAccessPolicy}
|
||||
newItemLabel="Add AWS Access Policy"
|
||||
>
|
||||
{i => (
|
||||
<>
|
||||
<PolicyAction policy={`extraResources.aws_access.policies.${i}`} />
|
||||
<FormikTextField
|
||||
className={classes.field}
|
||||
label="Resource"
|
||||
name={`extraResources.aws_access.policies.${i}.resource`}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</FormikCardList>
|
||||
</Grid>
|
||||
</NotConfigured>
|
||||
<>
|
||||
<NotConfigured
|
||||
name="AWS Access"
|
||||
addRemoveCondition={_m.hasAwsAccess(values)}
|
||||
addAction={() => setValues(_m.addAwsAccess(values))}
|
||||
removeAction={() => setValues(_m.removeAwsAccess(values), true)}
|
||||
markDisabled={values.environment === Environment.LOCAL}
|
||||
isDeployed={isDeployed}
|
||||
>
|
||||
<Grid container direction="column" className={classes.root}>
|
||||
<FormikCardList
|
||||
name="extraResources.aws_access.policies"
|
||||
newItem={_m.newAwsAccessPolicy}
|
||||
newItemLabel="Add AWS Access Policy"
|
||||
>
|
||||
{i => (
|
||||
<>
|
||||
<PolicyAction policy={`extraResources.aws_access.policies.${i}`} />
|
||||
<FormikTextField
|
||||
className={classes.field}
|
||||
label="Resource"
|
||||
name={`extraResources.aws_access.policies.${i}.resource`}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</FormikCardList>
|
||||
</Grid>
|
||||
</NotConfigured>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -802,34 +802,36 @@ const DatabaseForm = () => {
|
||||
isDeployedStatus = values.extraResources.database.isDeployed;
|
||||
}
|
||||
return (
|
||||
<NotConfigured
|
||||
name="Database"
|
||||
addRemoveCondition={_m.hasDatabase(values)}
|
||||
addAction={() => setValues(_m.addDatabase(values))}
|
||||
removeAction={() => setValues(_m.removeDatabase(values), true)}
|
||||
markDisabled={values.environment === Environment.LOCAL}
|
||||
isDeployed={isDeployedStatus}
|
||||
>
|
||||
<Grid container direction="column" justifyContent="flex-start" alignItems="flex-start">
|
||||
<Grid
|
||||
container
|
||||
direction="row"
|
||||
justifyContent="space-evenly"
|
||||
alignItems="flex-start"
|
||||
className={classes.gridRow}
|
||||
>
|
||||
<Grid item>
|
||||
<DatabaseEngineType />
|
||||
<DatabaseConfiguration />
|
||||
<DatabaseAdvancedConfiguration />
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<DatabaseAlerts />
|
||||
<DatabaseReplicas />
|
||||
<>
|
||||
<NotConfigured
|
||||
name="Database"
|
||||
addRemoveCondition={_m.hasDatabase(values)}
|
||||
addAction={() => setValues(_m.addDatabase(values))}
|
||||
removeAction={() => setValues(_m.removeDatabase(values), true)}
|
||||
markDisabled={values.environment === Environment.LOCAL}
|
||||
isDeployed={isDeployedStatus}
|
||||
>
|
||||
<Grid container direction="column" justifyContent="flex-start" alignItems="flex-start">
|
||||
<Grid
|
||||
container
|
||||
direction="row"
|
||||
justifyContent="space-evenly"
|
||||
alignItems="flex-start"
|
||||
className={classes.gridRow}
|
||||
>
|
||||
<Grid item>
|
||||
<DatabaseEngineType />
|
||||
<DatabaseConfiguration />
|
||||
<DatabaseAdvancedConfiguration />
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<DatabaseAlerts />
|
||||
<DatabaseReplicas />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</NotConfigured>
|
||||
</NotConfigured>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -267,32 +267,34 @@ const DocumentDbForm = () => {
|
||||
}, [values.name, values.environment]);
|
||||
|
||||
return (
|
||||
<NotConfigured
|
||||
name="DocumentDb"
|
||||
addRemoveCondition={_m.hasDocumentDb(values)}
|
||||
addAction={() => setValues(_m.addDocumentDb(values))}
|
||||
removeAction={() => setValues(_m.removeDocumentDb(values), true)}
|
||||
markDisabled={values.environment === Environment.LOCAL}
|
||||
isDeployed={isDeployed}
|
||||
>
|
||||
<Grid container direction="column" justifyContent="flex-start" alignItems="flex-start">
|
||||
<Grid
|
||||
container
|
||||
direction="row"
|
||||
justifyContent="space-evenly"
|
||||
alignItems="flex-start"
|
||||
className={classes.gridRow}
|
||||
>
|
||||
<Grid item>
|
||||
<DatabaseConfiguration isDeployed={isDeployed} />
|
||||
<DatabaseAdvancedConfiguration />
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<DocDBAlerts />
|
||||
<>
|
||||
<NotConfigured
|
||||
name="DocumentDb"
|
||||
addRemoveCondition={_m.hasDocumentDb(values)}
|
||||
addAction={() => setValues(_m.addDocumentDb(values))}
|
||||
removeAction={() => setValues(_m.removeDocumentDb(values), true)}
|
||||
markDisabled={values.environment === Environment.LOCAL}
|
||||
isDeployed={isDeployed}
|
||||
>
|
||||
<Grid container direction="column" justifyContent="flex-start" alignItems="flex-start">
|
||||
<Grid
|
||||
container
|
||||
direction="row"
|
||||
justifyContent="space-evenly"
|
||||
alignItems="flex-start"
|
||||
className={classes.gridRow}
|
||||
>
|
||||
<Grid item>
|
||||
<DatabaseConfiguration isDeployed={isDeployed} />
|
||||
<DatabaseAdvancedConfiguration />
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<DocDBAlerts />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</NotConfigured>
|
||||
</NotConfigured>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -372,117 +372,123 @@ const DynamoDbForm = () => {
|
||||
}, [values.extraResources]);
|
||||
|
||||
return (
|
||||
<NotConfigured
|
||||
name="DynamoDB Tables"
|
||||
addRemoveCondition={_m.hasDynamoDb(values)}
|
||||
addAction={() => setValues(_m.addDynamoDbTables(values))}
|
||||
removeAction={() => setValues(_m.removeDynamoDb(values), true)}
|
||||
markDisabled={values.environment === Environment.LOCAL}
|
||||
isDeployed={isDeployedStatus}
|
||||
>
|
||||
<Grid container direction="column" className={classes.root}>
|
||||
<Grid container direction="row" spacing={2}>
|
||||
<FormikCardList
|
||||
name="extraResources.dynamodb.tables"
|
||||
newItem={_m.newDynamoDbTable}
|
||||
newItemLabel="Add DynamoDb Table"
|
||||
removeCondition={getDynamoDbTablesStatus(values)}
|
||||
>
|
||||
{(i: string | number) => (
|
||||
<>
|
||||
<FormikTextField
|
||||
className={classes.field}
|
||||
label="Table Name"
|
||||
name={`extraResources.dynamodb.tables.${i}.tableName`}
|
||||
disabled={dynamoDbTablesDeploymentStatus[i]}
|
||||
/>
|
||||
<CardLayout heading="Table Properties">
|
||||
<TableContainer component={Paper} className={classes.attributeBox}>
|
||||
<Attributes attributesPath={`extraResources.dynamodb.tables.${i}.attributes`} />
|
||||
<Table aria-label="simple table">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
{tableHeader.map((header, i) => (
|
||||
<TableCell key={i}>{header}</TableCell>
|
||||
<>
|
||||
<NotConfigured
|
||||
name="DynamoDB Tables"
|
||||
addRemoveCondition={_m.hasDynamoDb(values)}
|
||||
addAction={() => setValues(_m.addDynamoDbTables(values))}
|
||||
removeAction={() => setValues(_m.removeDynamoDb(values), true)}
|
||||
markDisabled={values.environment === Environment.LOCAL}
|
||||
isDeployed={isDeployedStatus}
|
||||
>
|
||||
<Grid container direction="column" className={classes.root}>
|
||||
<Grid container direction="row" spacing={2}>
|
||||
<FormikCardList
|
||||
name="extraResources.dynamodb.tables"
|
||||
newItem={_m.newDynamoDbTable}
|
||||
newItemLabel="Add DynamoDb Table"
|
||||
removeCondition={getDynamoDbTablesStatus(values)}
|
||||
>
|
||||
{(i: string | number) => (
|
||||
<>
|
||||
<FormikTextField
|
||||
className={classes.field}
|
||||
label="Table Name"
|
||||
name={`extraResources.dynamodb.tables.${i}.tableName`}
|
||||
disabled={dynamoDbTablesDeploymentStatus[i]}
|
||||
/>
|
||||
<CardLayout heading="Table Properties">
|
||||
<TableContainer component={Paper} className={classes.attributeBox}>
|
||||
<Attributes
|
||||
attributesPath={`extraResources.dynamodb.tables.${i}.attributes`}
|
||||
/>
|
||||
<Table aria-label="simple table">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
{tableHeader.map((header, i) => (
|
||||
<TableCell key={i}>{header}</TableCell>
|
||||
))}
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{basicTableProperties.map(({ field, label, defaultValue }, j: number) => (
|
||||
<TableRow key={j}>
|
||||
<TableCell>{label}</TableCell>
|
||||
<TableCell>
|
||||
<FormikTextField
|
||||
select
|
||||
className={classes.dropdown}
|
||||
defaultValue={defaultValue}
|
||||
name={`extraResources.dynamodb.tables.${i}.${field}`}
|
||||
>
|
||||
{toMenuItems(
|
||||
attributesList(
|
||||
`extraResources.dynamodb.tables.${i}.attributes`,
|
||||
),
|
||||
)}
|
||||
</FormikTextField>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{basicTableProperties.map(({ field, label, defaultValue }, j: number) => (
|
||||
<TableRow key={j}>
|
||||
<TableCell>{label}</TableCell>
|
||||
<TableRow>
|
||||
<TableCell>Billing Mode</TableCell>
|
||||
<TableCell>
|
||||
<FormikTextField
|
||||
select
|
||||
className={classes.dropdown}
|
||||
defaultValue={defaultValue}
|
||||
name={`extraResources.dynamodb.tables.${i}.${field}`}
|
||||
select
|
||||
name={`extraResources.dynamodb.tables.${i}.billingMode`}
|
||||
>
|
||||
{toMenuItems(
|
||||
attributesList(`extraResources.dynamodb.tables.${i}.attributes`),
|
||||
)}
|
||||
{toMenuItems(billingOptions)}
|
||||
</FormikTextField>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
<TableRow>
|
||||
<TableCell>Billing Mode</TableCell>
|
||||
<TableCell>
|
||||
<FormikTextField
|
||||
className={classes.dropdown}
|
||||
select
|
||||
name={`extraResources.dynamodb.tables.${i}.billingMode`}
|
||||
>
|
||||
{toMenuItems(billingOptions)}
|
||||
</FormikTextField>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
{billingMode[i] === billingModeProvisioned ? (
|
||||
renderProvisioningTable(`extraResources.dynamodb.tables.${i}`)
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
<br />
|
||||
<br />
|
||||
<GSI
|
||||
gsiPath={`extraResources.dynamodb.tables.${i}.gsi`}
|
||||
attributesPath={`extraResources.dynamodb.tables.${i}.attributes`}
|
||||
billingMode={billingMode[i]}
|
||||
/>
|
||||
<br />
|
||||
<LSI
|
||||
lsiPath={`extraResources.dynamodb.tables.${i}.lsi`}
|
||||
attributesPath={`extraResources.dynamodb.tables.${i}.attributes`}
|
||||
/>
|
||||
<TableRow>
|
||||
<TableCell>
|
||||
<FormikTextField
|
||||
label="TTL AttributeName"
|
||||
name={`extraResources.dynamodb.tables.${i}.ttl.attribute_name`}
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<FormikCheckbox
|
||||
name={`extraResources.dynamodb.tables.${i}.ttl.enabled`}
|
||||
/>
|
||||
}
|
||||
label="TTL Enabled"
|
||||
/>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableContainer>
|
||||
</CardLayout>
|
||||
<DynamoDbAlerts tableNumber={i} />
|
||||
</>
|
||||
)}
|
||||
</FormikCardList>
|
||||
{billingMode[i] === billingModeProvisioned ? (
|
||||
renderProvisioningTable(`extraResources.dynamodb.tables.${i}`)
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
<br />
|
||||
<br />
|
||||
<GSI
|
||||
gsiPath={`extraResources.dynamodb.tables.${i}.gsi`}
|
||||
attributesPath={`extraResources.dynamodb.tables.${i}.attributes`}
|
||||
billingMode={billingMode[i]}
|
||||
/>
|
||||
<br />
|
||||
<LSI
|
||||
lsiPath={`extraResources.dynamodb.tables.${i}.lsi`}
|
||||
attributesPath={`extraResources.dynamodb.tables.${i}.attributes`}
|
||||
/>
|
||||
<TableRow>
|
||||
<TableCell>
|
||||
<FormikTextField
|
||||
label="TTL AttributeName"
|
||||
name={`extraResources.dynamodb.tables.${i}.ttl.attribute_name`}
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<FormikCheckbox
|
||||
name={`extraResources.dynamodb.tables.${i}.ttl.enabled`}
|
||||
/>
|
||||
}
|
||||
label="TTL Enabled"
|
||||
/>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableContainer>
|
||||
</CardLayout>
|
||||
<DynamoDbAlerts tableNumber={i} />
|
||||
</>
|
||||
)}
|
||||
</FormikCardList>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</NotConfigured>
|
||||
</NotConfigured>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -143,26 +143,28 @@ const ElasticCacheForm = () => {
|
||||
}, [values.name, values.environment]);
|
||||
|
||||
return (
|
||||
<NotConfigured
|
||||
name="Elastic Cache"
|
||||
addRemoveCondition={_m.hasElasticCache(values)}
|
||||
addAction={() => setValues(_m.addElasticCache(values))}
|
||||
removeAction={() => setValues(_m.removeElasticCache(values), true)}
|
||||
markDisabled={values.environment === Environment.LOCAL}
|
||||
isDeployed={isDeployed}
|
||||
>
|
||||
<Grid container direction="column" spacing={2} style={{ padding: 20 }}>
|
||||
<Grid container direction="row" spacing={2}>
|
||||
<Grid item>
|
||||
<ElasticCacheConfiguration instance={instance} isDeployed={isDeployed} />
|
||||
<ElasticCacheAdvancedConfiguration />
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<ElasticCacheAlerts />
|
||||
<>
|
||||
<NotConfigured
|
||||
name="Elastic Cache"
|
||||
addRemoveCondition={_m.hasElasticCache(values)}
|
||||
addAction={() => setValues(_m.addElasticCache(values))}
|
||||
removeAction={() => setValues(_m.removeElasticCache(values), true)}
|
||||
markDisabled={values.environment === Environment.LOCAL}
|
||||
isDeployed={isDeployed}
|
||||
>
|
||||
<Grid container direction="column" spacing={2} style={{ padding: 20 }}>
|
||||
<Grid container direction="row" spacing={2}>
|
||||
<Grid item>
|
||||
<ElasticCacheConfiguration instance={instance} isDeployed={isDeployed} />
|
||||
<ElasticCacheAdvancedConfiguration />
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<ElasticCacheAlerts />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</NotConfigured>
|
||||
</NotConfigured>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -293,62 +293,68 @@ const S3BucketForm = () => {
|
||||
isDeployedStatus = bucketsDeploymentStatus.includes(true);
|
||||
const disableFields = !environmentsNeedingAllMetadataFields.includes(values?.environment);
|
||||
return (
|
||||
<NotConfigured
|
||||
name="S3 Buckets"
|
||||
addRemoveCondition={_m.hasS3Bucket(values)}
|
||||
addAction={() => setValues(_m.addS3Bucket(values))}
|
||||
removeAction={() => setValues(_m.removeS3Bucket(values), true)}
|
||||
markDisabled={values.environment === Environment.LOCAL}
|
||||
isDeployed={isDeployedStatus}
|
||||
>
|
||||
<Grid container direction="column" className={classes.root}>
|
||||
<Announcement
|
||||
label="If you are creating a public S3, please make sure the bucket name starts with prefix
|
||||
<>
|
||||
<NotConfigured
|
||||
name="S3 Buckets"
|
||||
addRemoveCondition={_m.hasS3Bucket(values)}
|
||||
addAction={() => setValues(_m.addS3Bucket(values))}
|
||||
removeAction={() => setValues(_m.removeS3Bucket(values), true)}
|
||||
markDisabled={values.environment === Environment.LOCAL}
|
||||
isDeployed={isDeployedStatus}
|
||||
>
|
||||
<Grid container direction="column" className={classes.root}>
|
||||
<Announcement
|
||||
label="If you are creating a public S3, please make sure the bucket name starts with prefix
|
||||
'public-'. Also get the use-case reviewed by #security team before doing so in prod."
|
||||
/>
|
||||
<FormikCardList
|
||||
name="extraResources.s3_buckets"
|
||||
newItem={_m.newS3Bucket}
|
||||
newItemLabel="Add S3 Bucket"
|
||||
removeCondition={getBucketsDeploymentStatus(values)}
|
||||
>
|
||||
{i => (
|
||||
<>
|
||||
<FormikTextField
|
||||
className={classes.field}
|
||||
label="Anonymized Bucket Name"
|
||||
name={`extraResources.s3_buckets.${i}.anonymizedBucketName`}
|
||||
disabled={bucketsDeploymentStatus[i]}
|
||||
/>
|
||||
<FormikTextField
|
||||
className={classes.field}
|
||||
label="Simplified Bucket Name"
|
||||
name={`extraResources.s3_buckets.${i}.bucketTag`}
|
||||
/>
|
||||
<BucketMetadata
|
||||
s3Bucket={`extraResources.s3_buckets.${i}`}
|
||||
disableFields={disableFields}
|
||||
dataSensitivity={values?.extraResources?.s3_buckets?.[i]?.metadata?.DataSensitivity}
|
||||
/>
|
||||
<LifecycleRules s3Bucket={`extraResources.s3_buckets.${i}`} />
|
||||
<CorsPolicy s3Bucket={`extraResources.s3_buckets.${i}`} />
|
||||
<S3BucketPolicy s3Bucket={`extraResources.s3_buckets.${i}`} />
|
||||
<FormControlLabel
|
||||
control={<FormikCheckbox name={`extraResources.s3_buckets.${i}.enableAccessLog`} />}
|
||||
label="Server Side Access Log"
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<FormikCheckbox name={`extraResources.s3_buckets.${i}.enablePublicBucket`} />
|
||||
}
|
||||
className={classes.warning}
|
||||
label="Enable public access"
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</FormikCardList>
|
||||
</Grid>
|
||||
</NotConfigured>
|
||||
/>
|
||||
<FormikCardList
|
||||
name="extraResources.s3_buckets"
|
||||
newItem={_m.newS3Bucket}
|
||||
newItemLabel="Add S3 Bucket"
|
||||
removeCondition={getBucketsDeploymentStatus(values)}
|
||||
>
|
||||
{i => (
|
||||
<>
|
||||
<FormikTextField
|
||||
className={classes.field}
|
||||
label="Anonymized Bucket Name"
|
||||
name={`extraResources.s3_buckets.${i}.anonymizedBucketName`}
|
||||
disabled={bucketsDeploymentStatus[i]}
|
||||
/>
|
||||
<FormikTextField
|
||||
className={classes.field}
|
||||
label="Simplified Bucket Name"
|
||||
name={`extraResources.s3_buckets.${i}.bucketTag`}
|
||||
/>
|
||||
<BucketMetadata
|
||||
s3Bucket={`extraResources.s3_buckets.${i}`}
|
||||
disableFields={disableFields}
|
||||
dataSensitivity={
|
||||
values?.extraResources?.s3_buckets?.[i]?.metadata?.DataSensitivity
|
||||
}
|
||||
/>
|
||||
<LifecycleRules s3Bucket={`extraResources.s3_buckets.${i}`} />
|
||||
<CorsPolicy s3Bucket={`extraResources.s3_buckets.${i}`} />
|
||||
<S3BucketPolicy s3Bucket={`extraResources.s3_buckets.${i}`} />
|
||||
<FormControlLabel
|
||||
control={
|
||||
<FormikCheckbox name={`extraResources.s3_buckets.${i}.enableAccessLog`} />
|
||||
}
|
||||
label="Server Side Access Log"
|
||||
/>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<FormikCheckbox name={`extraResources.s3_buckets.${i}.enablePublicBucket`} />
|
||||
}
|
||||
className={classes.warning}
|
||||
label="Enable public access"
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</FormikCardList>
|
||||
</Grid>
|
||||
</NotConfigured>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user