ConnectToDatabaseInstructionsModal.tsx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import Helper from "components/form-components/Helper";
  2. import React, { useContext } from "react";
  3. import { Context } from "shared/Context";
  4. import styled from "styled-components";
  5. const ConnectToDatabaseInstructionsModal = () => {
  6. const { currentModalData } = useContext(Context);
  7. return (
  8. <Container>
  9. In order to get connection credentials for your RDS Postgres database,
  10. select <b>Load from Env Group</b> when launching or updating your
  11. application. Then, select the rds-credentials-{currentModalData?.name} env
  12. group.
  13. <p>
  14. This will set the following environment variables in your application:
  15. </p>
  16. <CodeBlock>
  17. <span>- PGHOST</span>
  18. <span>- PGPORT</span>
  19. <span>- PGUSER</span>
  20. <span>- PGPASSWORD</span>
  21. </CodeBlock>
  22. <Helper>Note: the database automatically listens on port 5432.</Helper>
  23. </Container>
  24. );
  25. };
  26. export default ConnectToDatabaseInstructionsModal;
  27. const CodeBlock = styled.span`
  28. display: block;
  29. background-color: #1b1d26;
  30. color: white;
  31. border-radius: 5px;
  32. font-family: monospace;
  33. user-select: text;
  34. max-height: 400px;
  35. width: 90%;
  36. margin-left: 5%;
  37. margin-top: 20px;
  38. overflow-x: hidden;
  39. overflow-y: auto;
  40. padding: 10px;
  41. overflow-wrap: break-word;
  42. > span {
  43. display: block;
  44. }
  45. `;
  46. const Container = styled.div`
  47. margin-top: 30px;
  48. line-height: 1.3rem;
  49. `;