我在 Laravel 8 中有一個專案,我有一些秘密的環境引數,我不想將它們與我的應用程式一起發送到 github。我將使用 github 操作將我的應用程式部署到 AWS beanstalk。在部署所有應用程式后,如何保護所有機密并將它們放入 EC2 實體。
uj5u.com熱心網友回復:
有多種方法可以做到這一點,您不應該將您的 env 檔案與您的應用程式一起發送到 github。
您可以使用 beanstalk 自己的引數存盤頁面。但是,如果您這樣做,其他有權訪問您的 AWS 賬戶的開發人員可以看到所有 env 引數。這是一個簡單的鍵值存盤頁面。
Benastalk 面板 ->(選擇您的環境)-> 配置 -> 軟體

- 在系統管理器下有一個名為 Parameter Store 的服務(這是我的首選方式)
在這里,您可以安全地添加任意數量的引數。您可以簡單地添加字串引數以及安全(如密碼或 api 密鑰)字串和整數,但字串和安全型別是我的最愛。
"APP_NAME/DB_NAME"您可以按路徑等拆分所有引數。

You should get all the parameters from Parameter Store to your EC2 instance and put them on newly created .env file.
- There is github secrets in github actions and you can put all your secret parameters to github secrets page. You can get all the secrets from github secrets and put your secrets to your application and ship from github to AWS directly.
You can go to settings in your repository and see this page:

轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/432541.html
標籤:拉拉维尔 亚马逊网络服务 亚马逊-ec2 亚马逊弹性豆茎
