English 中文(简体)
(ResourceInUseException)在称号可操作时发生错误: 现有表格:
原标题:An error occurred (ResourceInUseException) when calling the CreateTable operation: Table already exists:

下面列出错误,同时在气味中建立一个表,将3桶和装载数据输入有4个以上的表。

error in cloudwatchlogs:"module initialization error: An error occurred (ResourceInUseException) when calling the CreateTable operation: Table already exists: " sample code:

import boto3
s3 = boto3.client( s3 )
dynamodb = boto3.resource( dynamodb )
def txt_reader(event,context):
bucket_path = event[ Records ][0][ s3 ][ bucket ][ name ]
key_path = event[ Records ][0][ s3 ][ object ][ key ]
obj = s3.get_object(Bucket = bucket_path,Key = key_path)
body_rows = obj[ Body ].read().decode( utf-8 ).split( 
 )

# Create the DynamoDB table.
   table_name = dynamodb.create_table(
   TableName= TFM ,
     KeySchema=[
      {
         AttributeName :  CN ,
         KeyType :  HASH 
       },
    {
         AttributeName :  SN ,
         KeyType :  RANGE 
    }
],
AttributeDefinitions=[
    {
         AttributeName :  CN ,
         AttributeType :  S 
    },
    {
         AttributeName :  SN ,
         AttributeType :  S 
    },
    {
         AttributeName :  WF ,
         AttributeType :  S 
    },
],
#defining local secondary index on column WF
LocalSecondaryIndexes=[
           {
               IndexName :  WF ,
               KeySchema : [
                  {
                     KeyType :  HASH ,
                     AttributeName :  CN 
                },
                {
                     KeyType :  RANGE ,
                     AttributeName :  WF 
                }
            ],

             Projection : {
                 ProjectionType :  ALL ,
            }
        }
    ],
ProvisionedThroughput={
     ReadCapacityUnits : 5,
     WriteCapacityUnits : 5
}
)

table=dynamodb.Table(table_name)

#using a method batch_writer as batch below

with table.batch_writer() as batch:
    for row in body_rows:
        batch.put_item(Item = {
             CN :row.split( | )[0],
             SN :row.split( | )[1],
             WF :row.split( | )[2],
             sf :row.split( | )[3],
             Con :row.split( | )[4],
             LCI :row.split( | )[5]
            })

MY Queries: 请帮助我,在txt档案中为特定栏目提取一些随机的微粒数值,并在Mlambda操作该代码。

注:将使用的服务是作为资源的Dynamodb,S3作为客户。 在此情况下,如果出现错误,但可以发现,每节省代码和上载第3页的txt文档,表格也正在制作,然后出现上述错误。 我删除了表格,删除了Mlambda代码,将文件上载到S3,并再次出现同样的错误。 这里S3是触发因素。 我也发挥了S3-lambda-cloudwatchlogs-dynamodb的作用。

上文已经提到

问题回答

通常,表格的制作是多数情况下一次运行。 你应该用另一个文字制作桌子,如果它运作过一次,然后管理《拉姆布达法典》的其他部分。

如果有任何途径,你必须每次制作和销毁表格,然后在项目操作之前检查表格的状况。 因为一旦你执行表格,就会立即制作APIC。 它要求编制表格,同时制作。 这里是描述表_状况的理论,根据该表,在你管理项目时可以作出决定。

https://boto3.amazonaws.com/v1/documentation/api/latest/fer/services/dynamodb.html#DynamoDB.Table.table_status





相关问题
Mount windows shared drive to MWAA in bootscript

In MWAA startup script sudo yum install samba-client cifs-utils -y sudo mount.cifs //dev/test/drop /mnt/dev/test-o username=testuser,password= pwd ,domain=XX Executing above commonds giving error - ...

How to get Amazon Seller Central orders programmatically?

We have been manually been keying Amazon orders into our system and would like to automate it. However, I can t seem to figure out how to go about it. Their documentation is barely there. There is: ...

Using a CDN like Amazon S3 to control access to media

I want to use Amazon S3/CloudFront to store flash files. These files must be private as they will be accessed by members. This will be done by storing each file with a link to Amazon using a mysql ...

unable to connect to database on AWS

actually I have my website build with Joomla hosted on hostmonster but all Joomla website need a database support to run this database is on AWS configuration files need to be updated for that I ...

Using EC2 Load Balancing with Existing Wordpress Blog

I currently have a virtual dedicated server through Media Temple that I use to run several high traffic Wordpress blogs. Both tend to receive sudden StumbleUpon traffic surges that (I m assuming) ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

热门标签