Fix format errors and other small changes per suggestion

Signed-off-by: Sean Tan <seant@splunk.com>
This commit is contained in:
Sean Tan
2021-08-10 14:53:44 -07:00
parent fdece1f716
commit 9d5738b3f5
8 changed files with 25 additions and 17 deletions
+13 -11
View File
@@ -15,26 +15,28 @@ plugin.
## Configuration
To use this integration, add configuration to your root `app-config.yaml`:
To use this integration, add configuration to your `app-config.yaml`:
```yaml
awsS3:
- host: amazonaws.com
accessKeyId: ${AWS_ACCESS_KEY_ID}
secretAccessKey: ${AWS_SECRET_ACCESS_KEY}
integrations:
awsS3:
- host: amazonaws.com
accessKeyId: ${AWS_ACCESS_KEY_ID}
secretAccessKey: ${AWS_SECRET_ACCESS_KEY}
```
Then make sure the environment variables `AWS_ACCESS_KEY_ID` and
`AWS_SECRET_ACCESS_KEY` are set when you run Backstage.
Users with multiple AWS accounts may want to use a role for S3 storage that is
in a different AWS account. Using the roleArn parameter as seen below, you can
in a different AWS account. Using the `roleArn` parameter as seen below, you can
instruct the AWS S3 reader to assume a role before accessing S3:
```yaml
awsS3:
- host: amazonaws.com
accessKeyId: ${AWS_ACCESS_KEY_ID}
secretAccessKey: ${AWS_SECRET_ACCESS_KEY}
roleArn: 'arn:aws:iam::xxxxxxxxxxxx:role/example-role'
integrations:
awsS3:
- host: amazonaws.com
accessKeyId: ${AWS_ACCESS_KEY_ID}
secretAccessKey: ${AWS_SECRET_ACCESS_KEY}
roleArn: 'arn:aws:iam::xxxxxxxxxxxx:role/example-role'
```
+5
View File
@@ -104,6 +104,11 @@
],
"Integrations": [
"integrations/index",
{
"type": "subcategory",
"label": "AWS S3",
"ids": ["integrations/aws-s3/locations"]
},
{
"type": "subcategory",
"label": "Azure",
+2
View File
@@ -79,6 +79,8 @@ nav:
- FAQ: 'features/techdocs/FAQ.md'
- Integrations:
- Overview: 'integrations/index.md'
- AWS S3:
- Locations: 'integrations/aws-s3/locations.md'
- Azure:
- Locations: 'integrations/azure/locations.md'
- Org Data: 'integrations/azure/org.md'
+1 -1
View File
@@ -40,7 +40,7 @@
"@types/dockerode": "^3.2.1",
"@types/express": "^4.17.6",
"archiver": "^5.0.2",
"aws-sdk": "^2.952.0",
"aws-sdk": "^2.840.0",
"compression": "^1.7.4",
"concat-stream": "^2.0.0",
"cors": "^2.8.5",
@@ -147,7 +147,7 @@ describe('AwsS3UrlReader', () => {
new AwsS3Integration(
readAwsS3IntegrationConfig(
new ConfigReader({
host: '.amazonaws.com',
host: 'amazonaws.com',
accessKeyId: 'fake-access-key',
secretAccessKey: 'fake-secret-key',
}),
@@ -200,7 +200,7 @@ describe('AwsS3UrlReader', () => {
new AwsS3Integration(
readAwsS3IntegrationConfig(
new ConfigReader({
host: '.amazonaws.com',
host: 'amazonaws.com',
accessKeyId: 'fake-access-key',
secretAccessKey: 'fake-secret-key',
}),
@@ -33,7 +33,7 @@ const parseURL = (
let { host, pathname } = new URL(url);
/**
* Removes the trailing '/' from the pathname to be processed
* Removes the leading '/' from the pathname to be processed
* as a parameter by AWS S3 SDK getObject method.
*/
pathname = pathname.substr(1);
-1
View File
@@ -168,7 +168,6 @@ export interface Config {
awsS3?: Array<{
/**
* The host of the target that this matches on, e.g. "amazonaws.com".
*
* @visibility frontend
*/
host: string;
+1 -1
View File
@@ -17,7 +17,7 @@
import { Config } from '@backstage/config';
import { isValidHost } from '../helpers';
const AMAZON_AWS_HOST = '.amazonaws.com';
const AMAZON_AWS_HOST = 'amazonaws.com';
/**
* The configuration parameters for a single AWS S3 provider.