小编Mad*_*deo的帖子

无法复制 Elasticache 备份

我已逐步按照这些说明进行操作:https ://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/backups-exporting.html

但是我有以下错误:

An error occurred (InvalidParameterValue) when calling the CopySnapshot operation: Elasticache was unable to validate the authenticated user has access on the S3 bucket ...
Run Code Online (Sandbox Code Playgroud)

该存储桶与备份位于同一区域

这是我的存储桶配置:

{
    "LocationConstraint": "eu-central-1"
}

Run Code Online (Sandbox Code Playgroud)
{
    "Version": "2012-10-17",
    "Id": "xxxxxxxx",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "eu-central-1.elasticache-snapshot.amazonaws.com"
            },
            "Action": [
                "s3:PutObject",
                "s3:GetObject",
                "s3:ListBucket",
                "s3:GetBucketAcl",
                "s3:ListMultipartUploadParts",
                "s3:ListBucketMultipartUploads"
            ],
            "Resource": [
                "arn:aws:s3:::my-bucket-name/*",
                "arn:aws:s3:::my-bucket-name"
            ]
        }
    ]
}

Run Code Online (Sandbox Code Playgroud)

这是快照

{
    "Snapshots": [
        {
            "SnapshotName": "my-snapshot-name",
            "CacheClusterId": "xxxxxxxx-xxx",
            "SnapshotStatus": "available",
            "SnapshotSource": "manual",
            "CacheNodeType": …
Run Code Online (Sandbox Code Playgroud)

amazon-s3 amazon-web-services amazon-elasticache

6
推荐指数
1
解决办法
4291
查看次数

如何为postgres安装plpython?

我有 postgres 图像:https ://hub.docker.com/_/postgres 我正在尝试使用以下命令创建 python 扩展:

create extension plpythonu
Run Code Online (Sandbox Code Playgroud)

但它失败并出现错误:

psql:/docker-entrypoint-initdb.d/init.sql:1: ERROR:  could not open extension control file "/usr/share/postgresql/12/extension/plpythonu.control": No such file or directory

Run Code Online (Sandbox Code Playgroud)

在我的 Dockerfile 中,我尝试安装该包:

FROM postgres
RUN apt-get update -y
RUN apt install postgresql-plpython3-12

Run Code Online (Sandbox Code Playgroud)

我收到错误:


Unable to locate package postgresql-plpython3-12

Run Code Online (Sandbox Code Playgroud)

如何扩展 postgresql 以便我可以使用 python ?

postgresql debian docker

5
推荐指数
1
解决办法
3502
查看次数

在 nodejs 中使用异步配置进行 Sequelize

由于在 Sequelize 中找不到有效的异步配置示例,我已经为此苦恼了好几天

所以你可能知道,你可以像这样简单地配置一个 Sequelize 实例

const sequelize = new Sequelize('postgres://user:pass@example.com:5432/dbname')
Run Code Online (Sandbox Code Playgroud)

然后声明你的模型

const User = sequelize.define('User', {
  // Model attributes are defined here
  firstName: {
    type: DataTypes.STRING,
    allowNull: false
  },
  lastName: {
    type: DataTypes.STRING
    // allowNull defaults to true
  }
}, {
  // Other model options go here
});
Run Code Online (Sandbox Code Playgroud)

但是,当数据库凭据来自外部服务时会发生什么?

const sequelize = new Sequelize('postgres://user:pass@example.com:5432/dbname')
Run Code Online (Sandbox Code Playgroud)

由于续集模型的创建与实例的创建相结合(与许多其他 ORM 不同),这成为一个大问题。

我目前的解决方案如下:

const User = sequelize.define('User', {
  // Model attributes are defined here
  firstName: {
    type: DataTypes.STRING,
    allowNull: false
  },
  lastName: {
    type: …
Run Code Online (Sandbox Code Playgroud)

javascript asynchronous amazon-web-services node.js sequelize.js

3
推荐指数
1
解决办法
1691
查看次数

如何从 AWS Codebuild 构建规范文件中排除文件夹?

所以我需要从我的工件中排除一个文件夹,但谷歌搜索找不到任何信息。

version: 0.2

phases:
  install:
    runtime-versions:
      nodejs: 10
  build:
    commands:
    - echo Build started on `date`
     - echo Compiling the Node.js code
     - mocha test.js

  post_build:
    commands:
      - echo Build completed on `date`
artifacts:
  files:
    - '**/*'
Run Code Online (Sandbox Code Playgroud)

amazon-web-services aws-codebuild

2
推荐指数
1
解决办法
5229
查看次数

自定义 SAML 应用程序出现 AWS SSO“无访问错误”

我正在尝试使用 AWS SSO 设置自定义 SAML 2.0 应用程序。但是,我从网络选项卡中收到以下错误:

Status code 403
{"message":"No access","__type":"com.amazonaws.switchboard.portal#ForbiddenException"}
Run Code Online (Sandbox Code Playgroud)

UI 中显示的是这个:

在此输入图像描述

可能导致此错误的两个注意事项:

  1. 我的 SP 测试服务器正在本地主机中运行
  2. 我正在使用自签名证书:
openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=localhost:9000"
Run Code Online (Sandbox Code Playgroud)

如果这仍然没有告诉您任何信息,那么我将在下面描述更多内容。


更多细节

这是来自我正在使用的库的服务器代码

Status code 403
{"message":"No access","__type":"com.amazonaws.switchboard.portal#ForbiddenException"}
Run Code Online (Sandbox Code Playgroud)

该服务器公开一个端点,IDP 可以在其中获取我自动生成的元数据。

curl -o metadata.xml http://localhost:9000/saml/metadata
Run Code Online (Sandbox Code Playgroud)

这些是我的元数据:

<EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" validUntil="2021-09-13T03:37:23.951Z" entityID="http://localhost:9000/saml/metadata">
  <SPSSODescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" validUntil="2021-09-13T03:37:23.951204335Z" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol" AuthnRequestsSigned="false" WantAssertionsSigned="true">
    <KeyDescriptor use="encryption">
      <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
        <X509Data>
          <X509Certificate>xxxxxxxxxx</X509Certificate>
        </X509Data>
      </KeyInfo>
      <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"></EncryptionMethod>
      <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes192-cbc"></EncryptionMethod>
      <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"></EncryptionMethod>
      <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"></EncryptionMethod>
    </KeyDescriptor>
    <SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://localhost:9000/saml/slo" ResponseLocation="http://localhost:9000/saml/slo"></SingleLogoutService>
    <AssertionConsumerService …
Run Code Online (Sandbox Code Playgroud)

amazon-web-services single-sign-on saml-2.0

2
推荐指数
1
解决办法
8069
查看次数