PageSourceSearch

https://profisealabs.com/cabinet/static/js/AMAddUpdateAwsKey-CW-XIlge.js

js profisealabs.com collected 2026-09-25 18:33:50 UTC 17,938 bytes, 1 lines download raw bytes

1import{aY as O,j as e,a as C,d as L,b1 as P,br as M,N as A,ah as U,v,cn as E}from"./index-ChxFcAuc.js";import{a as S}from"./vendor-core-C0v-OB8t.js";import{w as K}from"./withBackBtn-BONWhaYS.js";import{m as z}from"./aws-connect-CNqsGt_d.js";import{D as H}from"./Details-BX-bDB-E.js";import{A as b}from"./aws-C7r99lL2.js";import{u as Y}from"./useSubmitAMAddUpdate-Boq0UmoD.js";import{F as m}from"./FormHorizontalFieldGroup-CJ0Vs0dE.js";import{F as y}from"./App-B3uEhegP.js";import{R as w}from"./Radio-CuOBtoku.js";import{S as _,A as R,P as $}from"./AMAddUpdatePolicyModal-DBRmXt8q.js";import{e as q,h as V}from"./main-Bgx8rRqW.js";import{S as T}from"./SwitchSelect-CK9-NzUo.js";import{A as G}from"./AMManualPopup-CDckMpCt.js";import{C as J}from"./CabinetSidebar-Bg1HsDj7.js";import{B as Q}from"./BlockHeader-BPNKvwRz.js";import{B as X}from"./BlockContent-DLwhzrem.js";import"./vendor-ant-ui-DEh1p71x.js";import"./useGetEnvsData-DkXREWrz.js";import"./CodeBlock-GR_VrOKS.js";import"./SwitchSelect.module-BauwmYHM.js";import"./PulsatingCircleAlarm-C5WCZoxH.js";const Z="subTitle_xTAnL",D="radioWrapper_jrWjA",ee="radio_3ynRW",se="radioText_uO3l2",ae="radioCaption_08jNP",ce="stackButtons_ypSZ9",te="policy_iDThv",ie="policyIcon_-uVh4",ne="policyText_0e4yN",a={subTitle:Z,radioWrapper:D,radio:ee,radioText:se,radioCaption:ae,stackButtons:ce,policy:te,policyIcon:ie,policyText:ne},le="label_Shrtp",re="checkbox_bLIZQ",oe="checkmark_YUpa-",de="checkmarkError_U-6em",pe="text_UvemL",me="error_Sr-Am",j={label:le,checkbox:re,checkmark:oe,checkmarkError:de,text:pe,error:me},he=({className:n,text:c,disabled:t,style:o,children:i,...l})=>{const[d,r]=O({...l,type:"checkbox"}),h=r.touched&&r.error;return e.jsxs("div",{className:C(j.wrapper,n),style:o,children:[e.jsxs("label",{className:j.label,children:[e.jsx("input",{type:"checkbox",className:j.checkbox,disabled:t,...d}),e.jsx("div",{className:C(j.checkmark,h&&j.checkmarkError),style:{marginRight:c||i?8:0},onClick:g=>{}}),e.jsx("p",{className:C(j.text,h&&j.textError),children:c||i})]}),h&&e.jsx("div",{className:j.error,children:r.error})]})},xe=({bucketName:n,envData:c,mode:t,setMode:o,connection:i,setConnection:l,propMode:d})=>{const r=x=>{const p={},{id:u,key:k,name:B}=x;return u.length!==b.accessKeyLength&&(p.id="Required length is 20"),k.length!==b.secretKeyLength&&(p.key="Required length is 40"),B.length>b.maxEnvNameLength&&(p.name=`Max length is ${b.maxEnvNameLength}`),p},h=L().id,{handleAdd:g,handleUpdate:I}=Y(),[f,N]=S.useState(!1),W=()=>window.open(q(t,n)),F=()=>window.open(V());return e.jsx(P,{initialValues:{id:"",key:"",name:(c==null?void 0:c.name)||"",save:!0},validate:r,onSubmit:async(x,{setSubmitting:p,setStatus:u})=>{p(!0);const k={auth_data:{aws_access_key_id:x.id,aws_secret_access_key:x.key},name:x.name,provider:U.aws,save_credentials:x.save,auth_type:"access_key",organization:h};c?await I({id:c.id,data:k,setStatus:u}):await g({data:k,setStatus:u}),p(!1)},children:({isSubmitting:x,status:p,values:u})=>e.jsxs(M,{children:[p&&e.jsx(m,{label:"",children:e.jsx("div",{style:{marginBottom:8,color:"red"},children:p})}),e.jsx(m,{label:"Account name",children:e.jsx(y,{name:"name",inputStyle:{width:360},placeholder:"e.g. AWS Stage",disabled:!!c})}),e.jsx(m,{label:"Access",style:{alignItems:"flex-start"},children:e.jsxs("div",{className:a.radios,children:[e.jsxs("div",{className:a.radioWrapper,children:[e.jsxs("div",{className:a.radio,onClick:()=>o("write"),children:[e.jsx(w,{style:{marginRight:0},value:"write",checked:t==="write",onChange:()=>o("write"),name:"write"}),e.jsx("p",{className:a.radioText,children:"Read/write"})]}),e.jsx("p",{className:a.radioCaption,children:"You will be able to actively save money and fix all issues"})]}),e.jsxs("div",{className:a.radioWrapper,children:[e.jsxs("div",{className:a.radio,onClick:()=>o("read"),children:[e.jsx(w,{style:{marginRight:0},value:"read",checked:t==="read",onChange:()=>o("read"),name:"read"}),e.jsx("p",{className:a.radioText,children:"Read-only"})]}),e.jsx("p",{className:a.radioCaption,children:"You will get full visibility of your cloud environment and optimization insights"})]})]})}),e.jsx(m,{label:"Connection",style:{alignItems:"flex-start"},children:e.jsxs("div",{className:a.radios,children:[e.jsxs("div",{className:a.radioWra
1pper,children:[e.jsxs("div",{className:a.radio,onClick:()=>l("cloudformation"),children:[e.jsx(w,{style:{marginRight:0},value:"cloudformation",checked:i==="cloudformation",onChange:()=>l("cloudformation"),name:"cloudformation"}),e.jsx("p",{className:a.radioText,children:"CloudFormation stack"})]}),e.jsx("p",{className:a.radioCaption,children:"IAM-user will be automatically created by CloudFormation stack"}),i==="cloudformation"&&e.jsxs("div",{className:a.stackButtons,children:[e.jsx(A,{text:"Launch now",type:"blue",size:"small",onClick:W}),e.jsxs("div",{className:a.policy,onClick:()=>N(!0),children:[e.jsx(_,{className:a.policyIcon}),e.jsx("p",{className:a.policyText,children:"Review policy"})]}),f&&e.jsx(R,{title:t==="read"&&"Read-only policy"||t==="write"&&"Read/write policy"||"",mode:t,onClose:()=>N(!1)})]})]}),e.jsxs("div",{className:a.radioWrapper,children:[e.jsxs("div",{className:a.radio,onClick:()=>l("manual"),children:[e.jsx(w,{style:{marginRight:0},value:"manual",checked:i==="manual",onChange:()=>l("manual"),name:"manual"}),e.jsx("p",{className:a.radioText,children:"Manual"})]}),e.jsx("p",{className:a.radioCaption,children:"You need to create new IAM user manually and provide long-term credentials"}),i==="manual"&&e.jsxs("div",{className:a.stackButtons,children:[e.jsx(A,{text:"Open AWS CONSOLE",type:"blue",size:"small",onClick:F}),e.jsxs("div",{className:a.policy,onClick:()=>N(!0),children:[e.jsx(_,{className:a.policyIcon}),e.jsx("p",{className:a.policyText,children:"Review policy"})]}),f&&e.jsx(R,{title:t==="read"&&"Read-only policy"||t==="write"&&"Read/write policy"||"",mode:t,onClose:()=>N(!1)})]})]})]})}),c&&i==="cloudformation"&&d!=="change"&&(c==null?void 0:c.auth_type)!=="access_key"?e.jsxs(m,{label:"Role ARN",style:{alignItems:"flex-start"},children:[e.jsx("p",{style:{marginBottom:8},children:"Paste created role to field bellow"}),e.jsx(y,{name:"arn",placeholder:"e.g. arn:aws:iam::867020061529:role/PSLabs",inputStyle:{width:360}})]}):e.jsxs(e.Fragment,{children:[e.jsx(m,{label:"Access key",children:e.jsx(y,{name:"id",inputStyle:{width:360},placeholder:"Paste access key here",counterMax:b.accessKeyLength})}),e.jsx(m,{label:"Secret key",children:e.jsx(y,{name:"key",inputStyle:{width:360},placeholder:"Paste secret key here",counterMax:b.secretKeyLength,type:"password"})})]}),e.jsx(m,{label:"",children:e.jsx(he,{name:"save",children:"Store access key and secret key for easy refresh"})}),e.jsx(m,{label:"",children:e.jsx(A,{text:c?"Reconnect account":"Connect account",type:"blue",size:"medium",style:{width:200},buttonType:"submit",disabled:u.key.length===0||u.id.length===0,submitting:x})})]})})},je="block_h6JcC",ue="step_Yuv8z",be="caption_WBX6G",ge="image_gNnRP",Ne="switches_RduUi",s={block:je,step:ue,caption:be,image:ge,switches:Ne},ke="/cabinet/static/assets/add-account-key-1-k_21HSlW.png",ye="/cabinet/static/assets/add-account-key-2-DFGhOOxD.png",we="/cabinet/static/assets/add-account-key-3-DuVvj80p.png",Se="/cabinet/static/assets/add-account-key-4-DRu0iQNb.png",Ce="/cabinet/static/assets/add-account-key-5-BLqPGFjh.png",Ae="/cabinet/static/assets/add-account-key-6-CqCFB79J.png",fe="/cabinet/static/assets/add-account-key-7-DqbrbgfJ.png",ve="/cabinet/static/assets/add-account-key-8-Cc2oj0p5.png",_e="/cabinet/static/assets/add-account-key-9-Bi8I31WM.png",Re="/cabinet/static/assets/add-account-key-10-DEW-tLW4.png",Te="/cabinet/static/assets/add-account-key-11-Va7u6esH.png",Ie="/cabinet/static/assets/add-account-key-12-CBOAu-IC.png",We="/cabinet/static/assets/add-account-key-13-BHLNSqLL.png",Fe="/cabinet/static/assets/add-account-key-14-DwqgQwiL.png",Be="/cabinet/static/assets/add-account-key-15-D1ejHFdm.png",Oe="/cabinet/static/assets/add-account-key-16-DCu4fk-W.png",Le="/cabinet/static/assets/add-account-key-17-t1rSFTNM.png",Pe="/cabinet/static/assets/add-account-key-18-D5qXPipF.png",Me="/cabinet/static/assets/add-account-key-19--O3pCfyO.png",Ue="/cabinet/static/assets/add-account-key-20-CJaxhH9W.png",Ee="/cabinet/static/assets/add-account-key-21-B0m8O_LQ.png",Ke=({mode:n})=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 1"}),e.jsxs("p",{className:s.caption,children:["Login to ",e.jsx("b",{children:"AWS Console"}),", type ",e.jsx("b",{children:"Billing"})," and navigate to ",e.jsx("b",{children:"AWS Billing Dashboard"})]}),e.jsx("img",{className:s.image,src:ke,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 2"}),e.jsxs("p",{className:s.caption,children:["Navigate to ",e.jsx("b",{children:"Cost & Usage Reports"}),". Then click ",e.jsx("b",{children:"Create report"})]}),e.jsx("img",{className:s.image,src:ye,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 3"}),e.jsxs("p",{className:s.caption,children:[e.jsx("b",{children:"Name"})," your report, check ",e.jsx("b",{children:"Include resource IDs"})," box and click ",e.jsx("b",{children:"Next"})]}),e.jsx("img",{className:s.image,src:we,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 4"}),e.jsxs("p",{className:s.caption,children:["Click ",e.jsx("b",{children:"Configure"})]}),e.jsx("img",{className:s.image,src:Se,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 5"}),e.jsxs("p",{className:s.caption,children:[e.jsx("b",{children:"Name"})," S3 as ",e.jsx("b",{children:"psl-cur-%AWS-account-id%"})," (paste your account ID instead of %AWS-account-id%), ",e.jsx("b",{children:"select the region"})," where you want to save S3 bucket, and click ",e.jsx("b",{children:"Next"}),". If you get an error that S3 bucket already exists, just select it from the dropdown list on the left."]}),e.jsx("img",{className:s.image,src:Ce,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 6"}),e.jsxs("p",{className:s.caption,children:["Check the box ",e.jsx("b",{children:"I have confirmed that this policy is correct"})," and click ",e.jsx("b",{children:"Save"}),"."]}),e.jsx("img",{className:s.image,src:Ae,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 7"}),e.jsxs("p",{className:s.caption,children:[e.jsx("b",{children:"Name Report path prefix"})," as ",e.jsx("b",{children:"psl-cur"}),", check ",e.jsx("b",{children:"Overwrite existing report"})," Radio button. Then check ",e.jsx("b",{children:"Amazon Athena"})," box and click ",e.jsx("b",{children:"Next"}),"."]}),e.jsx("img",{className:s.image,src:fe,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 8"}),e.jsxs("p",{className:s.caption,children:["Click ",e.jsx("b",{children:"Review and Complete"})]}),e.jsx("img",{className:s.image,src:ve,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 9"}),e.jsxs("p",{className:s.caption,children:["Type ",e.jsx("b",{children:"IAM"})," and navigate to ",e.jsx("b",{children:"IAM service page"})]}),e.jsx("img",{className:s.image,src:_e,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 10"}),e.jsxs("p",{className:s.caption,children:["Login to ",e.jsx("b",{children:"AWS Console"}),", type ",e.jsx("b",{children:"IAM"})," and navigate to ",e.jsx("b",{children:"IAM service page"})]}),e.jsx("img",{className:s.image,src:Re,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 11"}),e.jsxs("p",{className:s.caption,children:["Navigate to ",e.jsx("b",{children:"Policies"})," on the sidebar and click ",e.jsx("b",{children:"Create policy"})]}),e.jsx("img",{className:s.image,src:Te,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 12"}),e.jsxs("p",{className:s.caption,children:["Select ",e.jsx("b",{children:"JSON"})," tab and copy/paste ",e.jsx("b",{children:"AWS policy"})," below instead of %bucket_name%. Than click"," ",e.jsx("b",{children:"Next: Tags"})]}),e.jsx("img",{className:s.image,src:Ie,alt:""})]}),e.jsx($,{mode:n}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 13"}),e.jsxs("p",{className:s.caption,children:["Click ",e.jsx("b",{children:"Next: Review"})]}),e.jsx("img",{className:s.image,src:We,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 14"}),e.jsxs("p",{className:s.caption,children:[e.jsx("b",{children:"Name"})," you policy and click ",e.jsx("b",{children:"Create policy"})]}),e.jsx("img",{className:s.image,src:Fe,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 15"}),e.jsxs("p",{className:s.caption,children:["Navigate to ",e.jsx("b",{children:"Users"})," on sidebar and click ",e.jsx("b",{children:"Add users"})]}),e.jsx("img",{className:s.image,src:Be,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 16"}),e.jsxs("p",{className:s.caption,children:[e.jsx("b",{children:"Name"})," your user and check ",e.jsx("b",{children:"Access key - Programmatic access"})," box. Then click"," ",e.jsx("b",{children:"Next: Permissions"})]}),e.jsx("img",{className:s.image,src:Oe,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 17"}),e.jsxs("p",{className:s.caption,children:["Choose ",e.jsx("b",{children:"Attach existing policies directly"})," tab, type ",e.jsx("b",{children:"Policy name"})," created on step 5 in the search bar and check it"]}),e.jsx("img",{className:s.image,src:Le,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 18"}),e.jsxs("p",{className:s.caption,children:["Find ",e.jsx("b",{children:"ReadOnlyAccess"})," in the search bar and check it. Then click ",e.jsx("b",{children:"Next: Tags"})]}),e.jsx("img",{className:s.image,src:Pe,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 19"}),e.jsxs("p",{className:s.caption,children:["Click ",e.jsx("b",{children:"Next: Review"})]}),e.jsx("img",{className:s.image,src:Me,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 20"}),e.jsxs("p",{className:s.caption,children:["Click ",e.jsx("b",{children:"Create user"})]}),e.jsx("img",{className:s.image,src:Ue,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 21"}),e.jsxs("p",{className:s.caption,children:["Now copy/paste ",e.jsx("b",{children:"Access and Secret key"})]}),e.jsx("img",{className:s.image,src:Ee,alt:""})]})]}),ze="/cabinet/static/assets/step-1-fv6r48n5.png",He="/cabinet/static/assets/step-2-BDkOmpbx.png",Ye="/cabinet/static/assets/step-3-FANEF-XL.png",$e="/cabinet/static/assets/step-4-h7ac7wVd.png",qe=({})=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 1"}),e.jsx("p",{className:s.caption,children:"When you open CloudFormation page scroll down."}),e.jsx("img",{className:s.image,src:ze,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 2"}),e.jsx("p",{className:s.caption,children:"Check I Acknowledge that AWS CloudFormation might create IAM resources box and click Create stack button."}),e.jsx("img",{className:s.image,src:He,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 3"}),e.jsx("p",{className:s.caption,children:"Click Refresh button in 10-15 seconds. When Stack creation has been completed, go to the Outputs tab."}),e.jsx("img",{className:s.image,src:Ye,alt:""})]}),e.jsxs("div",{className:s.block,children:[e.jsx("p",{className:s.step,children:"Step 4"}),e.jsx("p",{className:s.caption,children:"Copy/paste Access and Secret key"}),e.jsx("img",{className:s.image,src:$e,alt:""})]})]}),Ve=({mode:n,setMode:c,connection:t,setConnection:o})=>{const i={write:"Write-mode",read:"Read-only"},l={cloudformation:"CloudFormation stack",manual:"Manual"};return e.jsxs("div",{children:[e.jsxs("div",{className:s.switches,children:[e.jsx(T,{data:Object.values(i),activeTab:i[n],onChange:d=>c(v(i).find(r=>i[r]===d))}),e.jsx(T,{data:Object.values(l),activeTab:l[t],onChange:d=>o(v(l).find(r=>l[r]===d))})]}),t==="manual"&&e.jsx(Ke,{mode:n}),t==="cloudformation"&&e.jsx(qe,{})]})}
1,Ge=({envData:n,mode:c,bucketName:t})=>{const[o,i]=S.useState(!1),[l,d]=S.useState(c&&c!=="change"?c:"write"),[r,h]=S.useState("cloudformation"),g=()=>{if(c){if(c==="write")return"Switch to read/write";if(c==="read")return"Switch to read-only"}return n?"Update account":"Access key connection"};return e.jsxs(E,{style:{minHeight:"100%"},children:[e.jsx(Q,{headerTitle:g()}),e.jsxs(X,{children:[e.jsx("p",{className:a.subTitle,children:c==="change"?`You need to reconnect ${n==null?void 0:n.name} with new Access key. It’s easy.`:"You can grant read-only or read/write access. You can switch between access modes and/or cancel the connection at any time."}),e.jsx(xe,{bucketName:t,envData:n,mode:l,setMode:d,connection:r,setConnection:h,propMode:c}),e.jsx(G,{moreThan1Manual:!0,position:{bottom:"30px",right:"50px"},popupPosition:{bottom:"10px",right:"0px"},image:z,title:"Access key connection",description:"Learn how to get credentials for to connect your AWS account.",onClick:()=>i(!0)})]}),o&&e.jsx(J,{width:"50%",children:e.jsx(H,{title:"Access key account connection. How to grant access?",onClose:()=>i(!1),children:e.jsx(Ve,{mode:l,setMode:d,connection:r,setConnection:h})})})]})},bs=K(Ge);export{bs as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.