diff --git a/CHANGELOG.md b/CHANGELOG.md index 9536644..99bcb9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## v0.1.3 + +- Fix style bug in temp credentials #59 + ## v0.1.2 - Only show grafana assume role on enabled datasources #58 diff --git a/package.json b/package.json index ddd2f0a..abd2de4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@grafana/aws-sdk", - "version": "0.1.2", + "version": "0.1.3", "description": "Common AWS features for grafana", "main": "dist/index.js", "module": "dist/esm/index.js", diff --git a/src/ConnectionConfig.tsx b/src/ConnectionConfig.tsx index 84ba81c..9f63e0d 100644 --- a/src/ConnectionConfig.tsx +++ b/src/ConnectionConfig.tsx @@ -1,5 +1,5 @@ import React, { FC, useEffect, useMemo, useState } from 'react'; -import { Input, Select, InlineField, ButtonGroup, ToolbarButton, FieldSet, Collapse } from '@grafana/ui'; +import { Input, Select, InlineField, ButtonGroup, ToolbarButton, FieldSet, Collapse, useStyles2 } from '@grafana/ui'; import { DataSourcePluginOptionsEditorProps, onUpdateDatasourceJsonDataOptionSelect, @@ -11,6 +11,7 @@ import { config } from '@grafana/runtime'; import { standardRegions } from './regions'; import { AwsAuthDataSourceJsonData, AwsAuthDataSourceSecureJsonData, AwsAuthType } from './types'; import { awsAuthProviderOptions } from './providers'; +import { css } from '@emotion/css'; export const DEFAULT_LABEL_WIDTH = 28; const DS_TYPES_THAT_SUPPORT_TEMP_CREDS = ['cloudwatch']; @@ -77,6 +78,7 @@ export const ConnectionConfig: FC = (props: ConnectionCon }, [loadRegions]); const inputWidth = inExperimentalAuthComponent ? 'width-20' : 'width-30'; + const styles = useStyles2(getStyles); return (
@@ -160,58 +162,60 @@ export const ConnectionConfig: FC = (props: ConnectionCon )} {options.jsonData.authType === AwsAuthType.GrafanaAssumeRole && ( - setIsARNInstructionsOpen(!isARNInstructionsOpen)} - > -
    -
  1. -

    - 1. Create a new IAM role in the AWS console, and select Another AWS account as the{' '} - Trusted entity. -

    -
  2. -
  3. -

    - 2. Enter the account ID of the Grafana account that has permission to assume this role: - 008923505280 and check the Require external ID box. -

    -
  4. -
  5. -

    - 3. Enter the following external ID:{' '} - {props.externalId || 'External Id is currently unavailable'} and click Next. -

    -
  6. -
  7. -

    - 4. Add any required permissions you would like Grafana to be able to access on your behalf. For more - details on our permissions please{' '} - - read through our documentation - - . -

    -
  8. -
  9. -

    - 5. Give the role a name and description, and click Create role. -

    -
  10. -
  11. -

    - 6. Copy the ARN of the role you just created and paste it into the Assume Role ARN field - below. -

    -
  12. -
-
+
+ setIsARNInstructionsOpen(!isARNInstructionsOpen)} + > +
    +
  1. +

    + 1. Create a new IAM role in the AWS console, and select Another AWS account as the{' '} + Trusted entity. +

    +
  2. +
  3. +

    + 2. Enter the account ID of the Grafana account that has permission to assume this role: + 008923505280 and check the Require external ID box. +

    +
  4. +
  5. +

    + 3. Enter the following external ID:{' '} + {props.externalId || 'External Id is currently unavailable'} and click Next. +

    +
  6. +
  7. +

    + 4. Add any required permissions you would like Grafana to be able to access on your behalf. For more + details on our permissions please{' '} + + read through our documentation + + . +

    +
  8. +
  9. +

    + 5. Give the role a name and description, and click Create role. +

    +
  10. +
  11. +

    + 6. Copy the ARN of the role you just created and paste it into the Assume Role ARN field + below. +

    +
  12. +
+
+
)} {awsAssumeRoleEnabled && ( @@ -282,3 +286,11 @@ export const ConnectionConfig: FC = (props: ConnectionCon
); }; + +function getStyles() { + return { + assumeRoleInstructions: css({ + maxWidth: '715px', + }), + }; +}