Hi <@U01J5Q8HV5Z> this is such an awesome resource...
# help
k
Hi @Jay this is such an awesome resource - thanks for you what guys do - quick question - am trying to deploy to a custom dev domain but facing this issue “Resource is not in the state certificateValidated” - tried a few things (delete and redeploy, etc) but with no luck.. it will be great if I can get some pointers.. thanks a lot
f
Hey @karthik, can you show me where you are seeing the error?
k
in the frontend stack deployment
dev2-mydomain-frontend | ROLLBACK_COMPLETE | AWS:CloudFormation:Stack | dev2-mydomain-frontend dev2-mydomain-frontend failed: Received response status [FAILED] from custom resource. Message returned: Resource is not in the state certificateValidated (RequestId: 8310a468-1c3d-4c6b-b9b9-dbad8777cf50)
Copy code
const site = new sst.ReactStaticSite(this, "ReactSite", {
      customDomain:
  scope.stage === "prod"
    ? {
        domainName: "mydomainname",
        domainAlias: "www.mydomainname",
      }
    : {
      domainName: `${scope.stage}.mydomainname`
    },
    hostedZone:"mydomainname",
      path: "frontend",
      // Pass in our environment variables
      environment: {
        REACT_APP_API_URL: api.customDomainUrl || api.url,
        REACT_APP_REGION: scope.region,
        REACT_APP_BUCKET: bucket.bucketName,
        REACT_APP_USER_POOL_ID: auth.cognitoUserPool.userPoolId,
        REACT_APP_IDENTITY_POOL_ID: auth.cognitoCfnIdentityPool.ref,
        REACT_APP_USER_POOL_CLIENT_ID:
          auth.cognitoUserPoolClient.userPoolClientId,
      },
    });
I tested it with a few different sub domain names (after creating the corresponding 53 subdomain hosted zone) but still ending up with the same error. Stack testing-mydomain-frontend Status: failed Error: Received response status [FAILED] from custom resource. Message returned: Resource is not in the state certificateValidated (RequestId: bcd5bc51-8f4e-4a59-97e0-ce36c7e8e0eb)
f
Thanks for the details @karthik.
Is the domain hosted on Route53?
k
yes
f
And in the same AWS account you are deploying the React site into?
k
yes thats correct
f
can you DM me the domain name?
k
fwiw, i have no issues with the prod site
sure
f
Can you try this:
Copy code
customDomain:
  scope.stage === "prod"
    ? {
        domainName: "mydomainname",
        domainAlias: "www.mydomainname",
      }
    : {
        domainName: `${scope.stage}.mydomainname`
        hostedZone: "mydomainname",
      },
Pretty much specify the
hostedZone
in custom domain
k
thats what i have now
f
oh.. the
hostedZone:"mydomainname",
line seems to be outside of the
customDomain
block
k
let me try this.. I have this hostedZone outside as of now
f
yup
k
yep..
I think that did it.. thanks for jumping in so quick!!
f
No worries! Glad it’s working!